txt = list(input())
a = txt.pop(0)
temp = [a]
while(len(txt) != 0):
  #print(temp)
  a = txt.pop(0)
  if a == temp[-1]:
    if len(txt) >= 1:
      a += txt.pop(0)
      temp.append(a)
    else:
      temp[-1] += a
  #print(a)
  else:
    temp.append(a)
print(len(temp))