#Lutece1384. 卿大爷的多个女友

卿大爷的多个女友

Migrated from Lutece 1384 卿大爷的多个女友

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

卿大爷发现了一个字符串,他要在上面找到多个女朋友的名字。 他的女朋友们有一个特点,名字相同且紧密连接在一起,卿大爷想知道这些名字总长的最大值。 也就是说,寻找给定字符串的最长连续重复子串的长度。 连续重复子串的定义是一个由某一个子串连续重复拼接而成的串。 如cdaabababcccdaabababcc的最长连续重复子串为abababababab,长度为66。(由abab连续重复拼接而成)

Input

只含一行,字符串ss1<=s<=1000001<=|s|<=100000,均由小写字母构成。

Output

字符串ss的最长连续重复子串长度

Samples

cdaabababcc
6

Resources

2016 UESTC Training for Search Algorithm & String