S = list(input())

ans = 1
prev = S[0]
for i in range(1, len(S)):
    if prev == S[i]:
        prev = prev + S[i]
        if i == len(S) - 1:
            ans += 1
    else:
        ans += 1
        prev = S[i]

print(ans)
