S = list(input())
ans = 0
ind = 0
flag = False
while ind < len(S)-1:
    if S[ind] != S[ind+1] or flag:
        ans += 1
        ind += 1
        flag = False
    else:
        ans += 1
        ind += 2
        flag = True
if S[-1] == S[-2]:
    ans -= 1
print(ans+1)
