S = input()
Sl = S[0]
count = 1
i = 0
N = len(S)
f = False

for i in range(1, N):
  if f:
    f = False
    count += 1
  elif S[i] == Sl and i < N-1:
    f = True
    Sl = S[i]+S[i+1]
  else:
    count += 1
    Sl = S[i]
if N > 1 and S[N-2] == S[N-1]:
  print(count - 1)
else:
  print(count)