23_A. You're Given a String...
You're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).

Input

The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Latin letters, and its length doesn't exceed 100.

Output

Output one number — length of the longest substring that can be met in the string at least twice.

Examples

Input

abcd


Output

0

Input

ababa


Output

3

Input

zzz


Output

2
```python
s = input()
k = []
for i in range(len(s)):
    for j in range(i+1,len(s)+2):
        x = s[i:j]
        for t in range(i+1,len(s)):
            if x == s[t:t+j-i]:
                k += [j-i]
print(max(k) if k != [] else 0)
```