def main():

    S = eval(input())

    ans = 0

    for i in range(len(S)-1):

        if S[i] != S[i+1]:

            ans += 1

    print(ans)





if __name__ == '__main__':

    main()

def main():

    S = eval(input())

    N = len(S)

    ans = 0

    for i in range(1, N):

        if S[i-1] != S[i]:

            ans += 1

    print(ans)





if __name__ == '__main__':

    main()

def main():
    S = eval(input())
    ans = 0
    for i in range(len(S) - 1):
        if S[i] != S[i + 1]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    S = eval(input())
    N = len(S)
    ans = 0
    for i in range(1, N):
        if S[i - 1] != S[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

+    N = len(S) -    for i in range(len(S) - 1): -        if S[i] != S[i + 1]: +    for i in range(1, N): +        if S[i - 1] != S[i]: