def solve(s):
  memo = [0]*(len(s)+1)
  def dp(string):
    l = len(string)
    if l == 0:
      return 0
    elif l == 1:
      return 1
    elif l == 2:
      if s[0] == s[1]:
        return 1
      else:
        return 2
    elif s[-1] == s[-2]:
      return memo[l-3] + 2
    else:
      return memo[l-1] + 1
  for i in range(len(s)):
    memo[i+1] = dp(s[:i+1])
  return memo[-1]

print(solve(input()))