s = raw_input()
# s = "aabbaa"

f = [0 for _ in range(len(s)+1)]

for i in range(len(s)+1):
    for j in range(i):
        if s[2*j-i:j] == s[j:i]:
            f[i] = max(f[i], f[j]+1-f[2*j-i])
        else:
            f[i] = max(f[i], f[j]+1)
print f[-1]