s = list(input())
a = s[0]
cou = 1
i = 1
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(a,cou,i)
if a==s[-1] and len(a)==1:
  print(cou)
elif a=="".join(s[-2:]) and len(a)==2 and i==len(s)-2:
  print(cou)
else:
  print(cou+1)