s = list(input())
n = len(s)
ans = 0
pre = "*"

for i in range(n):
    if pre != s[i]:
        pre = s[i]
        ans += 1
        
    else:
        pre += s[i]
        
        if i == n - 1:
            ans += 1
        
print(ans)