s = input()
  N = len(s)
  ans = 0

  tmp = ""
  i = 0
  while i < N:
if not tmp == s[i]:
tmp = s[i]
            ans += 1
  else:
tmp = ""
  i += 1
  if not i == N:
ans += 1
  i += 1
  # print(tmp, ans, i)

  print(ans)