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()
  n = len(s)
  
  l = [s[0]]
  
  i = 1
  while i < n:
    for t in range(i+1, n):
      if l[-1] != s[i:t]:
        l += [s[i:t]]
        i = t
        break
    else:
      l[-1] += s[i:t]
      break

  s = s[::-1]
  m = [s[0]]
  
  i = 1
  while i < n:
    for t in range(i+1, n):
      if m[-1] != s[i:t]:
        m += [s[i:t]]
        i = t
        break
    else:
      m[-1] += s[i:t]
      break
  
  print(l,'\n',m,file=sys.stderr)
  print(max(len(l),len(m)))


solve()