txt = list(input())
count = 1
hitotsu = True
a = txt.pop(0)
while(len(txt) != 0):
  #print(txt, count)
  if hitotsu:
    if a != txt[0]:
      a = txt.pop(0)
      gitotsu = True
    else:
      if len(txt) >= 2:
        a = txt.pop(0)
        a += txt.pop(0)
        hitotsu = False
        count += 1
      else:
        count += 1
        break
  else:
    a = txt.pop(0)
    hitotsu = True
    count += 1
print(count)