def f(x):
  if x<=2:
    if x==2 and S[0]==S[1]:
      return 1
    else:
      return x
  else:
    if S[x-1]==S[x-2]:
      return f(x-3)+2
    else:
      return f(x-1)+1
S=input()
print(f(len(S)))
  