s = input()
num = len(s)
ans = 0

def count(pos, befor):
  co = 0
  if pos >= num:
    ans = 12
    #print(li, len(li))
    return 1
  
  for p in range(1, num-pos+1):
    if s[pos:pos+p] != befor:
      a = count(pos + p, s[pos:pos+p])
      if a and a > co:
        co = a
        

  return co + 1

ans = count(0, "")
print(ans - 1)
