A font sheet is described by a string of lowercase English letters. You may delete individual characters. The sheet is balanced when no two distinct letters that still appear have the same number of occurrences. Determine the minimum number of deletions needed to reach a balanced state. Deleting all copies of a letter is allowed (that letter then no longer appears).
Input format
Line 1: the string of lowercase English letters.
Output format
A single integer: the minimum number of character deletions required.
Constraints
- 1 <= length of the string <= 40
- The string consists only of lowercase English letters.