Given a string, determine the minimum number of characters that need to be deleted such that there are only one or two distinct letters remaining.
Constraints
The string only consists of lowercase letters.
Input Specification
The input consists of a single string of length
Output Specification
Print, on a single line, the minimum number of characters to be deleted.
Sample Input 1
Copy
abc
Sample Output 1
Copy
1
Sample Input 2
Copy
aab
Sample Output 2
Copy
0
Comments