Count Of Substrings Having All Unique Characters

easy
1. You are given a string.
2. You have to find the count of valid substrings of the given string.
3. Valid substring is defined as a substring that has all unique characters. 

Input Format

A string

Output Format

A number representing the count of substrings having all unique characters.

Constraints

1 <= length of string <= 10^5

Example

Input
aabcbcdbca
Output
24
Previous
Longest Substring With Non Repeating Characters
Next
Longest Substring With Exactly K Unique Characters

Related Questions