S = eval(input())



ans = 0

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

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

        ans += 1



print(ans)
# python3 (3.4.3)

import sys

input = sys.stdin.readline



# main

S = input().rstrip()



ans = 0

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

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

        ans += 1



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

# python3 (3.4.3)
import sys

input = sys.stdin.readline
# main
S = input().rstrip()
ans = 0
for i in range(1, len(S)):
    if S[i] != S[i - 1]:
        ans += 1
print(ans)

-S = eval(input()) +# python3 (3.4.3) +import sys + +input = sys.stdin.readline +# main +S = input().rstrip() -    if S[i - 1] != S[i]: +    if S[i] != S[i - 1]: