def bunkatu(s):
  res = len(s)
  ans = list(s[0])
  for i in range(res-1):
    if (ans[-1] != s[i]):
      ans.append(s[i])
    else:
      ans[-1]+= s[i]
  return len(ans)

      
s = input()

print(bunkatu(s))
