s=list(input())
l=len(s)
ans=0
moji=''
t=0
while t<=l-2:
    if s[t]==moji:
        moji=s[t]+s[t+1]
        t+=2
        ans+=1
    else:
        moji=s[t]
        t+=1
        ans+=1  
#    print(moji)
if s[-1]==moji:
    print(ans)
else:
    print(ans+1)


