a = input()

def recur(s,out,ans):
  if len(s) == 0:
    if all([out[i] != out[i+1] for i in range(len(out)-1)]) and len(out) > ans:
      ans = len(out)
    return ans
  for i in range(len(s)):
    out.append(s[:i+1])
    ans = recur(s[i+1:],out,ans)
    out.pop(len(out)-1)
  return ans
    
out = []; ans = 0
ans = recur(a, out,ans)
print(ans)