import sys

def input(): return sys.stdin.readline()

def solve():
  s = input()
  ans = 0
  t = p = ''

  for i in range(len(s)):
    t += s[i]
    if t == p:
      continue
    p = t
    t = ''
    ans += 1

  print(ans)


if __name__ == '__main__':
  solve()