s = input()
ans = len(s)
f = 0
if len(s)==2 and len(set(s))==1:
  print(1)
  exit()
for i in range(1, len(s)):
  if f==1:
    f = 0
    ans -= 1
  elif f==0 and s[i]==s[i-1]:
    f = 1
  else:
    continue
print(ans)