s = list(input())
a = s[0]
cou = 0
i = 0
while i!=len(s) and i!=len(s)+1:
  if s[i]!=a:
    cou += 1
    a = s[i]
    i += 1
   # print(0,a,cou,i)
  else:
    a = "".join(s[i:i+2])
    cou += 1
    i += 2
  #  print(10,a,cou,i)
print(cou)