s = input()
maximum = [(0, ())]

s = tuple(s)
for i in range(1, len(s) + 1):
    j = i - 1
    while j >= 0:
        max_count, previous = maximum[j]
        if max_count < 0:
            j -= 1
            continue
        current = s[j:i]
        if current != previous:
            maximum.append((max_count + 1, current))
            break
        j -= 1
    else:
        maximum.append((-1, ()))

print(maximum[-1][0])