There is a string of characters 'a' and 'b' with the length of no more than 255 characters.
You can perform the substring reduction on the initial string in the following way:
a substring "a*a" or "b*b" (where * (asterisk) denotes any character) can be reduces to a substring "*".
The task is to achieve a string of minimal possible length after several substring reductions.
The input contains the initial string.
The output contains a single line with the minimal possible length.
Northeastern Europe 2001, Western Subregion