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).
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.
s=input()
n=len(s)
m=n-1;
while m>0:
       find=False
       for i in range(0,n-m):
             for j in range(i+1,n-m+1):
                   match=True
                   for k in range(0,m):
                         if s[i+k] != s[j+k]:
                             match=False
                             break
                   if match:
                          find=True
                          break
            if find:
                break
       if find:
           break
       m-=1
print(m)