S = list(input())
N = len(S)
i = 1
ans = N

if N == 2:
    if S[0] == S[1]:
        ans = 1
    else:
        ans = 2
    print(ans)
    exit()

while i < N-1:
    if S[i] == S[i+1]:
        i += 2
        ans -= 1
    else:
        i+= 1

print(ans)