S = list(input())
prev = ''
K = []

while len(S) > 0:
    text = S.pop(0)
    K.append(text)
    while text == prev:
        if len(S) == 0:
            text = prev + text
            K.pop(-1)
        else:
            text += S.pop(0)
    prev = text
    K[-1] = text

print(len(K))