ls=list(input())
ans=0
for i in range(len(ls)):
    if i==0:
        ans+=1
    elif 1<=i<=len(ls)-2:
        if ls[i]=='':
            pass
        else:
            if ls[i]==ls[i-1]:
                ans+=1
                ls[i+1]=''
            else:
                ans+=1
    else:
        if ls[i]==ls[i-1]:
            pass
        else:
            ans+=1
print(ans)            
    