import numpy as np



S=eval(input())

S=np.array([1 if s=='B' else 0 for s in S])



print((np.abs(np.diff(S)).sum()))

from itertools import groupby



S=eval(input())

answer = sum([1 for _ in groupby(S)]) -1



print(answer)
import numpy as np

S = eval(input())
S = np.array([1 if s == "B" else 0 for s in S])
print((np.abs(np.diff(S)).sum()))

from itertools import groupby

S = eval(input())
answer = sum([1 for _ in groupby(S)]) - 1
print(answer)

-import numpy as np +from itertools import groupby -S = np.array([1 if s == "B" else 0 for s in S]) -print((np.abs(np.diff(S)).sum())) +answer = sum([1 for _ in groupby(S)]) - 1 +print(answer)