s = input()

n = 2 ** (len(s) - 1)
answer = 0
for w_n in range(n):
    wk_li = []
    w_s = s
    bin_str = format(w_n, f'0{len(s) - 1}b')
    idx = 1
    flag = True
    for w in bin_str:
        if w == '1':
            tmp = w_s[:idx]
            if len(wk_li) != 0 and wk_li[-1] == tmp:
                flag = False
            wk_li.append(tmp)
            w_s = w_s[idx:]
            idx = 1
        else:
            idx += 1
    if len(wk_li) != 0 and wk_li[-1] == w_s:
        flag = False
    wk_li.append(w_s)
    if flag:
        answer = max(answer, len(wk_li))
print(answer)
