s=input()

max_len=0
tmp=""
for i in range(1,len(s)+1):
  arr=[s[:i]]
  for s_ in s[i:]:
    tmp+=s_
    if tmp != arr[-1]:
      arr.append(tmp)
      tmp=''
  max_len=max(max_len,len(arr))

print(max_len)