txt = list(input())
a = txt.pop(0)
b = a
count = 1
while(len(txt) != 0):
  #print(temp)
  a = txt.pop(0)
  if a == b:
    if len(txt) >= 1:
      a += txt.pop(0)
      b = a
      count += 1
    else:
      b += a
  #print(a)
  else:
    b = a
    count += 1
print(count)