s = input()

if len(s) == 2 and s[0]==s[1]:
  print(1)
else:
  i = 0
  c = 0
  a = s[i]
  while i <  len(s)-1:
      b = s[i]
      if a == b:
          a = s[i: i+2]
          i +=2
      else:
          a = s[i]
          i += 1
      c += 1
  print(c+1)