import sys

def divide(S, i, prv_S):
  tmp_S = ""
  for index in range(i+1,len(S)):
    tmp_S = tmp_S + S[index]
    if tmp_S != prv_S:
      return index, tmp_S
  return len(S)+1, None

S = sys.stdin.readline()
ans = 0
prv_S = None

# Sが一文字の時
if len(S) == 1:
  print(1)
  exit()

ans_list = []
for i in range(len(S)):
  prv_S = S[:i+1]
  index_S = i
  ans = 1
  #print(i, ans, index_S, prv_S)
  #S2以降を決める
  while index_S < len(S)-1:
    index_S, prv_S = divide(S, index_S, prv_S)
    ans += 1
    #print(i, ans, index_S, prv_S, len(S))
  if index_S == len(S)-1:
    ans_list.append(ans)
  if len(S) - i < max(ans_list):
    print(max(ans_list))
    exit()
print(max(ans_list))