S = eval(input())

c=1

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

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

    c+=1

print((c-1))
def solve():

    S = eval(input())

    ans = S.count('BW')+S.count('WB')

    return ans

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

def solve():
    S = eval(input())
    ans = S.count("BW") + S.count("WB")
    return ans


print((solve()))

-S = eval(input()) -c = 1 -for i in range(len(S) - 1): -    if S[i] != S[i + 1]: -        c += 1 -print((c - 1)) +def solve(): +    S = eval(input()) +    ans = S.count("BW") + S.count("WB") +    return ans + + +print((solve()))