A border (verge, brink) of a string is any proper prefix of the string that is equal to its suffix.
For example, the string S = abaababaabaab has two non-empty borders: and .
The string S = abaabaab also has two such borders — and , with the second border being overlapping.
A string of length consisting of a repeated character (for example, or a^8) has n - 1 borders. For S = a^8, these borders are: , , , , , , .
The term proper prefix excludes the border that coincides with the entire string.
The length of a border is the number of characters it contains.
A natural generalization of the border is the longest border — the longest proper prefix of the string that is equal to its suffix.
One string S~(|S| \le 10^{6}).
Print the length of the longest border of the string .
Example 1