s = list(input())
ans=0
cach=-1
while True:
    if s==[]:
        break
    else:
        tmp=s.pop(0)

    if tmp != cach:
        ans +=1
        cach=tmp
    else:
        if s!=[]:
            tmp+=s.pop(0)
            ans +=1
            cach=tmp

print(ans)
