s = str(input())
ans = 0
n = len(s)
A = [s[-1]]
count=0
i = n-1
while i>=0:
    if i == n-1:
        i-=1
    else:
        if A[count]==s[i]:
            A.append(s[i]+s[i-1])
            i -=2
            count+=1
        elif A[count]!=s[i] and i>1:
            A.append(s[i])
            count+=1
            i -= 1
        elif i==1 and s[i]==s[i-1]:
            A.append(s[i]+s[i-1])
            i-=2
        elif i==1 and s[i]!=s[i-1]:
            A.append(s[i])
            A.append(s[i-1])
            i-=2
print(len(A))