#coding: utf-8;

data = input()
#\nは？

K = 0
count = 0
prev = ""
now = ""
i = 0

while True:
  if count==len(data)-1:
    if now != "":
      K+=1 #???
    break

  now += data[count]
  count += 1
  if now != prev:
    prev = now
    now = ""
    K += 1

print(K)