s = input()

ans = 0
p = "0"
q = ""
for i in range(len(s)):
    if p == "0":
        ans += 1
        p = s[i]
        continue

    q += s[i]
    if q == p:
        continue
    else:
        ans += 1
        p = s[i]
        q = ""

print(ans)
        
    
        
        

                                        




    




        


    







        

