Palindrome

No attempts yetTime limit2sMemory limit128 MB

Problem

You are given a string of lowercase letters. The appearance value of a substring is the number of times it occurs in the string multiplied by its length. Write a program that prints the largest appearance value among all palindrome substrings.

Input

The first line contains a string of lowercase letters (a-z). The length is at most 300,000.

Output

Print the largest appearance value among palindrome substrings on one line.

Hint

Let s|s| denote the length of string ss. A substring is a non-empty string sisi+1sjs_i s_{i+1} \ldots s_j with 1ijs1 \leq i \leq j \leq |s|. A palindrome reads the same from left to right and from right to left. A large appearance value can come from a short substring that appears many times or from a long palindrome that appears once.