Nijat's string#280

Nijat's string

1 second
128 megabytes
Easy (≈1000)

Nijat had a string consisting of and . He had nothing to do and came up with such a game. Nijat can perform the following operations on the string:

You are given the remaining string after Nijat completes all operations (the number of performed operations can be ). Find the smallest possible initial length of the given string.

For example, from the string , you can obtain or .

Input

The input consists of a string of length at most 10^5, composed of and .

Output

Output the minimal length of the string Nijat initially had.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading