14020 - Longest Palindrome Substring   

Description

Given multiple strings composed of only {'A','T','C','G'}.

That is, for any char c in the strings, c == 'A' or c == 'T' or c== 'C' or c== 'G'.

Find the length of the longest palindrome substring in each given string and output its length.

 

Palindrome: a string that is identical to its reverse, like "level" or "aba".

 

Substring: a contiguous sequence of characters within a string. For example, "ABC" , "CDEF" and "G" are substrings of "ABCDEFG", but "ACDE" isn't, because it is not contiguous in the main string. Note that a string is a substring of itself.

 

Input

The input consists of multiple test cases.

Each of the test cases contains a string.

 

It is guaranteed that the length of each given string will not exceed 10000.

 

Output

For each given string, print the length of the longest palindrome substring of that string, ended with a new line character '\n'.

 

 

Sample Input  Download

Sample Output  Download

Tags




Discuss