#C6730. Make the String Perfect
Make the String Perfect
Make the String Perfect
The problem is to convert a given string s into a "perfect" string by performing the minimum number of operations. A string is defined as perfect if all of its characters are identical. In each operation, you can change any character to any other character. The goal is to make the string perfect with the minimum number of changes.
More formally, let \( n \) be the length of the string and let \( f(x) \) be the frequency of character \( x \) (where \( x \in \{a, b, c\} \)). The answer is given by:
[ \text{operations} = n - \max{f(a), f(b), f(c)} ]
You are guaranteed that the string s consists only of the characters 'a', 'b', and 'c'.
inputFormat
The input consists of a single line containing a non-empty string s composed only of the characters 'a', 'b', and 'c'.
outputFormat
Output a single integer, the minimum number of operations required to make the string perfect.
## sampleabc
2