#STRANG. English

English

Someone thinks that someone thinks that someone thinks that...,

Trang is a nice girl who is keen on learning English to make her study abroad dream come true. She practices everyday that her progress impresses the teacher. On Trang 's birthday, she receive an English book from her teacher. The interesting thing is that the book contain only one (very long) sentence ! Trang is surprised that she cannot understand any word and decides to learn every word in the sentence. She wants to learn the longest word first, but it should appear in the string a few times since Trang is curious about the meaning of the sentence. Help her to find the first word to learn !

 

You are given a string S (the sentence), which its length can be up to 100000, including only lowercase alphabetical letters ('a'..'z'). A word is defined as a subtring of consecutive characters and each is assigned an “important” value, which is equal ((length of the word) * (number of times it occurred in the sentence)).

 

INPUT: One line containing the string S.

OUTPUT: One number, the “important” value of the most “important” word.

Sample Input:

abcabcdddlo

 

Sample Output:

11


Sample Input:

aaaaaa

 

Sample Output:

12