s = input()
i = 0
now = s[0]
ans = 1
while i <=len(s)-1:
    if i ==len(s) -1:
        break
    if len(now)==2:
        now = s[i+1]
        i += 1
        ans+=1
    if len(now)==1:
        if now != s[i+1]:
            now = s[i+1]
            i +=1
            ans+=1
        else:
            if i+2 <= len(s)-1:
                now = s[i+1:i+3]
                ans +=1
            i +=2
print(ans)