import copy
import itertools
S = input()

K = 0
S__ = []

for i in reversed(range(len(S))):
    S_ = list(itertools.combinations(range(len(S) - 1), i))
    for j in S_:
        j = list(j)

        index = 0
        buff = ""
        S__ = []
        for k in range(len(S)):
            if index >= len(j):
                buff += S[k:]
                S__.append(buff)
                buff = ""
                break
            buff += S[k]

            if k == j[index]:
                S__.append(buff)
                buff = ""
                index += 1

        for k in range(len(S__) - 1):
            if S__[k] != S__[k+1]:
                if k == len(S__) - 2:
                    print(len(S__))
                    exit(0)
            else:
                break