from sys import setrecursionlimit
setrecursionlimit(10000*10000)

def dfs(res, depth, path, S):
    if depth == len(S) - 1:
        res[0] = max(res[0], len(path))
        return
    for i in range(depth+1, len(S)):
        if not path or path[-1] != S[depth:i]:
            dfs(res, i, path + [S[depth:i]], S)
            break

S = input()
S += '*'
    
res = [0]
dfs(res, 0, [], S)

print(res[0])
