Problem3942--CCC16J3 HiddenPalindrome

3942: CCC16J3 HiddenPalindrome

Time Limit: 2000 Sec  Memory Limit: 1 MB
Submit: 16  Solved: 5
[Submit] [Status] [Web Board] [Creator:]

Description

A palindrome is a word which is the same when read forwards as it is when read backwards. For example, mom and anna are two palindromes. 
A word which has just one letter, such as a, is also a palindrome. 
Given a word, what is the longest palindrome that is contained in the word? That is, what is the longest palindrome that we can obtain, if we are allowed to delete characters from the beginning and/or the end of the string?

Input

The input will consist of one line, containing a sequence of at least 1 and at most 40 lowercase letters.

Output

Output the total number of letters of the longest palindrome contained in the input word.

Sample Input Copy

banana

Sample Output Copy

5

Source/Category

CCC