The largest border#1307

The largest border

1 second
128 megabytes
Very easy

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.

Input

One string S~(|S| \le 10^{6}).

Output

Print the length of the longest border of the string .

Examples

Example 1

Loading
Loading