Huseyn has a string consisting of characters and . To entertain himself, he came up with the following game. Huseyn can perform one of two operations on the string:
append to the left end, and to the right end;
append to the right end, and to the left end;
For example, from the string , Huseyn can obtain or .
You are given a string obtained after all of Huseyn's operations (it is possible that he did not perform any operation). Determine the smallest possible length the string could have initially had.
A single string of length no more than 10^5, consisting only of characters and .
Print the smallest possible length of the string that Huseyn could have initially had.
Example 2
Example 1