s = input()

max_dicts = [{"": 0}]
for i in range(1, 1 + len(s)):
    dic = {}
    for j in range(0, i):
        try:
            dic[s[j:i]] = max(v for k, v in max_dicts[j].items() if k != s[j:i]) + 1
        except:
            pass
    max_dicts.append(dic)

print(max(dic.values()))
