#%%
S = list(input())

ans = 0
count = 0
i = 0

while i < len(S):
    if i == 0:
        tmp = S[i]
        ans += 1
        i += 1
    else:
        for j in range(1, len(S)):
            if S[i:i+j] != tmp:
                tmp = S[i:i+j]
                ans += 1
                i += j
               # print(tmp)
                break

print(ans - 1)

