s = list(input())

cached = []
candidate = ''
prev = ''
while len(s) > 0:
  candidate += s.pop(0)
  if candidate != prev:
    cached.append(candidate)
    prev = candidate
    candidate = ''

print(len(cached))
