s = eval(input())

c = s[0]

cnt = 0

for i in range(1, len(s)):

    if s[i] != c:

        cnt += 1

        c = s[i]

print(cnt)
def main():

    from itertools import tee



    S = eval(input())

    it1, it2 = tee(iter(S), 2)

    next(it2)



    ans = 0

    for c1, c2 in zip(it1, it2):

        if c1 != c2: ans += 1

    print(ans)





if __name__ == '__main__':

    main()

s = eval(input())
c = s[0]
cnt = 0
for i in range(1, len(s)):
    if s[i] != c:
        cnt += 1
        c = s[i]
print(cnt)

def main():
    from itertools import tee

    S = eval(input())
    it1, it2 = tee(iter(S), 2)
    next(it2)
    ans = 0
    for c1, c2 in zip(it1, it2):
        if c1 != c2:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-s = eval(input()) -c = s[0] -cnt = 0 -for i in range(1, len(s)): -    if s[i] != c: -        cnt += 1 -        c = s[i] -print(cnt) +def main(): +    from itertools import tee + +    S = eval(input()) +    it1, it2 = tee(iter(S), 2) +    next(it2) +    ans = 0 +    for c1, c2 in zip(it1, it2): +        if c1 != c2: +            ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()