S=input()
answer=0
cur=0
is_pair=False
while cur < len(S)-1:
    answer+=1
    if not is_pair:
        if S[cur] == S[cur+1]:
            is_pair=True
            cur+=1
        # print(S[cur])

    else:
        is_pair=False
        # print(S[cur-1:cur+1])
    cur+=1
if S[-1] != S[-2]:
    answer += 1
print(answer)