beecrowd | 3098

Plindrome

By Ygor Ribeiro, IFSULDEMINAS BR Brazil

Timelimit: 1

Mr. Eliezer is very fond of plindromes, that's right, plindromes and not palindromes. He doesn't like the letter "a" very much, so the name is written that way. Eli, for those closest to him, has just come home tired and is unable to do what he likes best, which is: Take a random word and find out the size of the largest plindrome of that word. He is so tired, he ended up forming some plindromes with the letter "a" and he didn't like it at all.

Then you, as a great friend of Lord Eliezer, will help you. Given any word, tell us the size of the largest plindrome of that word. Take care not to make him even more angry by making the same mistake he has recently made.

For those who have never heard of plindromes, let us help you: A plindrome is a word that is read from left to right and is equivalent to it from right to left. To form a plindrome we cannot change the order of the letters in the original word!

Example: Word "ribeiro", the largest plindrome of that word is "rieir", of size 5. Note that this is not the only plindrome of that word, but there is none larger than 5.

Input

The input contains an S (1 <= |S| <= 1000) string, with no spaces and only lowercase letters, representing the word in which you must find the plindrome.

Output

The output must contain the size of the largest plindrome of that word.

Input Samples Output Samples

ribeiro

5

subinoonibus

12

xixixi

5

xixixi

5