S = input()

def f(sets, s):
    if len(s) == 1: return s not in sets
    res = 0
    for i in range(1, len(s)+1):
        if s[:i] not in sets:
            #sets.add(s[:i])
            res = max(res, 1 + f(sets | set(s[:i]),s[i:]))
    return res
print(f(set(),S))