S = input()

ans = 0
#print(S)
i = 0
num = 0
skip = 0
while num  <= 100:
#  print(len(S))
  if skip == 1:
#    print(S[1]+S[i+1])
    i += 2
    ans += 1
    skip = 0
  else:
#    print(S[i])
    if S[i] == S[i + 1]:
      skip = 1
    else:
      skip = 0
    i += 1
    ans += 1
#  print(S[i])
#  print(i)
  if i >= (len(S)-1):
    break
if skip == 0:
  ans += 1
#  num += 1
#if i == len(S)-1:
#  ans -= 1
print(ans)