s=input()
ans=0
k=0
k2=[]
k1=[]
for i in range(len(s)-1):
    if s[i]!=s[i+1] :
        k1.append(s[k:i+1])
        print(k1[0])
        if k1!=k2:
            if  k2:
                del k2[0]
            k2.append(k1[0])
            del k1[0]
            ans+=1
        k=i+1
    
        
    
if ans==0:
    ans=1
elif ans==1:
    ans=2
else:
    ans=ans+2
print(ans)