import functools
def find(s):
    
    A=[s]
    @functools.lru_cache()
    def findout(k):
        s=A[0]
        if k==1:
            return 1
        if k==2:
            if s[0]==s[1]:
                return 1
            else:
                return 2
        if s[k-1]==s[k-2]:
            return findout(k-3)+2
        else:
            return findout(k-1)+1
    return findout(len(s))
        
print(find(input()))