S=input()
tmp=S[0]
i=1
ans=1
while i<len(S):
    # print(S[i],tmp)
    if S[i]!=tmp:
        ans+=1
        tmp=S[i]
        i+=1
    else:
        ans+=1
        tmp=S[i:i+2]
        i+=2
if len(S)!=1:
    if S[-2]==S[-1] and tmp!=S[-2:]:
        ans-=1
print(ans)