Echo Frames
An archivist has a strip of cells. Cell contains the character .
A stamping plan chooses two starting cells and and a positive block length such that:
- ;
- both blocks fit on the strip, so and ;
The score of the plan is the block length multiplied by the distance between its starting cells:
Find the maximum score of any valid stamping plan. If no valid plan exists, the answer is .
Input
The only line contains the string , consisting of lowercase English letters. Its length satisfies .
Output
Print one integer: the maximum possible score of a valid stamping plan. If no valid plan exists, print .
Samples
Sample 1
Input
abcd
Output
0
No two nonempty equal blocks can be selected, so there is no valid stamping plan.
Sample 2
Input
aaaaa
Output
6
One optimal plan uses , , and . The two blocks are both aa, and their score is .