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
  prev = ''

  i = 0
  while i < len(s):
    l = 1
    if s[i:i+l] == prev: l += 1
    if i + l > len(s): break
    prev = s[i:i+l]
    i += l
    ans += 1

  print(ans)


solve()