S = list(input())

ans = 1
r = 1
s = 0
while r <= len(S)-1:  #貪欲に
    if S[r] != S[r-1] or s == 1:
        ans += 1
        r += 1
        s = 0
    else:
        ans += 1
        r += 2
        s = 1

print(ans)