A = input()
B=1
try:
        for i in range(len(A)):
            if A[-1] != A[-2]:
                B += 1
                A = A[:-1]
            elif A[-1] == A[-2] and A[-2] == A[-3]:
                B += 2
                A = A[:-3]
            else:
                B += 2
                A = A[:-3]
except IndexError:
    print(B)