S = input()
def f(i):
    if i == 0:
        return 0
    if i == 1:
        return 1
    if i == 2:
        if S[i-1] == S[i-2]:
            return 1
        else:
            return 2
    if S[i-1] == S[i-2]:
        return f(i-1) + 1
    else:
        return f(i-3) + 2

print(f(len(S)))