import sys
stdin = sys.stdin

ni = lambda: int(ns)
ns = lambda: stdin.readline().rstrip()
na = lambda: map(int, stdin.readline().split())


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)))


if __name__ == '__main__':
  solve()