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.
The first line contains the string (1 \le |s| \le 3 \cdot 10^5).
Output a single integer — the maximum interest among all non-empty palindromic strings.
Example 1
Example 2
In the first example, the single-letter palindrome «a» appears four times in the string , but the palindrome «abacaba» has the highest interest.
( points): 1 \le |s| \le 100;
( points): 1 \le |s| \le 1\,000;
( points): 1 \le |s| \le 10\,000;
( points): 1 \le |s| \le 100\,000;
( points): no additional constraints.