def f(x):
  if x==0:
    return 0
  elif x==1:
    return 1
  elif x==2:
    if S[0]==S[1]:
      return 1
    else:
      return 2
  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)))
  