Huseyn's game
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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.
Input
A single string of length no more than , consisting only of characters and .
Output
Print the smallest possible length of the string that Huseyn could have initially had.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 812
Acceptance rate 42%