S = input()
idx = 0
prev = ""
ans = 0
for i in range(len(S)):
  if i == len(S):
    break
  s = S[idx]
  if len(prev) != 1:
    idx += 1
    prev = s
    ans += 1
    continue
  if prev == s:
    if idx != len(S)-1:
      idx += 2
      ans += 1
      prev = S[idx:idx+2]
      continue
    else:
      idx += 1
      continue
  ans += 1
  idx += 1
  prev = s
print(ans)