from collections import deque
s = deque(x for x in input())
s.append(0)
k = 0
l = [s[0]]
while True:
  if s[0] == 0:
    break
  elif l[k] == s[0]:
    l.append(s.popleft()+s.popleft())
  else:
    l.append(s.popleft())
  k += 1
print(len(l))