SP21132 APIO14_A - Palindromes

Description

You are given a string of lower-case Latin letters. Let us define substring’s “occurrence value” as the number of the substring occurrences in the string multiplied by the length of the substring. For a given string find the largest occurrence value of palindromic substrings.

Input Format

The only line of input contains a non-empty string S of lower-case Latin letters (a-z), |S|

Output Format

Output one integer – the largest occurrence value of palindromic substrings.