import copy
S=list(input())
ans=1
l=S.pop(0)
while len(S)>=1:
    x=S.pop(0)
    if l!=x:
        ans+=1
        l=copy.deepcopy(x)
    else:
        if len(S)>=1:
            ans+=1
            l=copy.deepcopy(x)+S.pop(0)
        else:
            break
print(ans)

