S = input()



def f(prev, s):
    if len(s) == 0: return 0
    if len(s) == 1 and s != prev:
        return 1
    elif len(s) == 1: return 0
    for i in range(1, len(s)+1):
        if s[:i] != prev:
            return 1 + f(s[:i], s[i:])
print(f("",S))