s0 = input()
s = [x for x in s0]
c = 0
i = 0
j = 0
t = [0]*(len(s)+5)

t[0] = s[0]
while i < len(s):
  if t[i] != s[j+1]:
    t[i+1] = s[j+1]
    i += 1
    j += 1
  else:
    t[i+1] = s[j+1] + s[j+2]
    i += 2
    j += 1
print(j)