s=list(input())
c=1
i=1
f=1
w=[s[0]]
while i<len(s)-1:
    if s[i]==s[i-1] and f:
        w.append(s[i]+s[i+1])
        i+=1
        c+=1
        i+=1
        f=0
    else:
        w.append(s[i])
        f=1
        c+=1
        i+=1
if s[-1]!=w[-1]:
    w.append(s[-1])
print(len(w))
