def sol():
    S = input()

    right  = 0
    left = 0
    ans = 1
    while right < len(S):
        while right < len(S) and S[left] == S[right]:
            right += 1
        ans += 1
        left = right

    print(ans)

sol()