S = input()
count = 0
i = 0
hantei = 0
while  hantei == 0:
  if S[i] == S[i + 1]:
    count += 1
    i += 2
    if i == len(S):
      hantei = 1
    elif i == len(S)-1:
      hantei = 2
  else:
    i += 1
    count += 1
    if i == len(S):
      hantei = 1
    elif i == len(S) - 2:
      hantei = 2

if hantei == 1:
  print(count + hantei)
else:
  print(count + hantei)