s=input()
stack=[]
stack.append([0,set(),0])
while stack:
  node=stack.pop()
  ind=node[0]
  seen=node[1]
  depth=node[2]
  if ind==len(s):
    print(depth)
    break
  for i in range(len(s[ind:])-1,0,-1):
    if s[ind:ind+i] not in seen:
      w=set(seen)
      stack.append([ind+i,w,depth+1])
    