S = ['0'] + list(input())

def g(i):
    if i == 0:
        return 0
    if i == 1:
            return 1
    if i == 2:
        if S[2] == S[1]:
            return 1
        else:
            return 2     

    if S[i] == S[i - 1]:
        return g(i - 3) + 2
    if S[i] != S[i - 1]:
        return g(i - 1) + 1
# print (len(S) - 1)
print (g(len(S) - 1))