import sys

input = sys.stdin.readline
input_list = lambda: map(int, input().split())

dup = lambda x,y: ((x)+(y)-1)//(y)


def f(s):
  ans = [s[0]]
  n = len(s)
  i = 1
  while i < n:
    for t in range(i+1, n):
      if ans[-1] != s[i:t]:
        ans += [s[i:t]]
        i = t
    else:
      ans[-1] += s[i:n]
      i = n
  
  return len(ans)


def solve():
  s = input()
  print(max(f(s), f(s[::-1])))


solve()