#P3401. String reduction

String reduction

Description

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.

Input

The input contains the initial string.

Output

The output contains a single line with the minimal possible length.

aab
3

Source

Northeastern Europe 2001

, Western Subregion