S = input()
count = 0
i = 0
hantei = 0

if len(S) == 1 or len(S) == 2:
  print(1)
else:
  while  hantei == 0:
    if S[i] == S[i + 1]:
      count += 1
      i += 2
      if i == len(S):
        hantei = 1
      elif i == len(S)-1:
        if  len(S) == 3:
          hantei = 1
        else:
          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)