s=input()
S=list(s)
count=1
a=[]
a.append(S[0])
S.remove(S[0])
while 0<len(S):
        x=S[0]
        if a[len(a)-1]!=x:
            a.append(x)
            S.remove(S[0])
        else:
            S.remove(S[0])
            while x==a[len(a)-1] and len(S)>0:
                x+=S[0]
                S.remove(S[0])
            if x!=a[len(a)-1]:
                a.append(x)
#print(a)
print(len(a))