Mr. A and Palindromes
Easy
Execution time limit is 1 second
Runtime memory usage limit is 256 megabytes
Mr. B gave Mr. A a string , composed of lowercase Latin letters. The friends defined the "interest" of a non-empty string as the number of times appears in the string , multiplied by the length of . Your task is to determine the maximum interest among all non-empty palindromic strings.
A palindrome is a string that reads the same forwards and backwards.
Input
The first line contains the string .
Output
Output a single integer — the maximum interest among all non-empty palindromic strings.
Examples
Input #1
Answer #1
Input #2
Answer #2
Note
In the first example, the single-letter palindrome "a" appears four times in the string , but the palindrome "abacaba" has the highest interest.
Scoring
( points): ;
( points): ;
( points): ;
( points): ;
( points): no additional constraints.
Submissions 77
Acceptance rate 6%