Facets of the line.
A border of a string T is defined as a proper prefix that matches a suffix. For instance, the string T = abaababaabaab has two non-empty borders: ab and abaab. Similarly, the string T = abaabaab also has two non-empty borders: ab and abaab, with the second border overlapping its prefix. A string made up of identical characters has n-1 borders; for example, T = aaaaaaaa has the borders: a, aa, aaa, aaaa, aaaaa, aaaaaa, aaaaaaa. The length of a border is the number of characters it contains. Among all borders, the largest border is the longest proper prefix that is also a suffix. Your task is to find the length of the largest border of the given string T.
Input
The input consists of a single line containing the string T (1 ≤ size(T) ≤ 10^5
), where all characters are Latin letters.
Output
Output a single integer representing the length of the largest border.