s=input()
S=list(s)
count=1
a=[]
a.append(S[0])
S.remove(S[0])
x=''
for i in range(len(S)-1):
    if a[len(a)-1]!=S[i]:
        a.append(S[i])
        count+=1
    else:
            x+=S[i]
            if a[len(a)-1]!=x:
                a.append(x)
                x=''
            else:
                continue
print(len(a))
