word = list(input())
p = 0
pre = word[0]
for i in range(len(word)):
  if len(pre) == 2:
    pre = "あ"
  else:
    if word[i] == pre and i == len(word) - 1:
      pass
    elif word[i] == pre:
      pre = word[i] + word[i + 1]
      p += 1
    else:
      pre = word[i]
      p += 1
print(p)
  