A substring is called special if every character that appears in the string appears the same number of times in the substring.
Your task is to count the number of special substrings in a given string.
The only input line has a string of length $n$ . Every character is between a...z.
Print one integer: the number of special substrings.
abccabab
\n
5
\n
The special substrings are abc , cab , abccab , bccaba and ccabab .