from itertools import*;print((len([k for k,g in groupby(eval(input()))])-1))
x=eval(input());print((x.count("WB")+x.count("BW")))
from itertools import *

print((len([k for k, g in groupby(eval(input()))]) - 1))

x = eval(input())
print((x.count("WB") + x.count("BW")))

-from itertools import * - -print((len([k for k, g in groupby(eval(input()))]) - 1)) +x = eval(input()) +print((x.count("WB") + x.count("BW")))