s,ans=eval(input()),0

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

  if s[i]!=s[i+1]:ans+=1

print(ans)
s=eval(input())

n=len(s)

ans=s.count("WB")

anss=s.count("BW")

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

s = eval(input())
n = len(s)
ans = s.count("WB")
anss = s.count("BW")
print((ans + anss))

-s, ans = eval(input()), 0 -for i in range(len(s) - 1): -    if s[i] != s[i + 1]: -        ans += 1 -print(ans) +s = eval(input()) +n = len(s) +ans = s.count("WB") +anss = s.count("BW") +print((ans + anss))