import sys
 
input = sys.stdin.readline
input_list = lambda: map(int, input().split())
 
dup = lambda x,y: ((x)+(y)-1)//(y)
 
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)


solve()