S = eval(input())

ans = 0

for a,b in zip(S,S[1:]):

    if a != b:

        ans += 1

print(ans)
S = eval(input())

ans = len([1 for a,b in zip(S,S[1:]) if a!=b])

print(ans)
S = eval(input())
ans = 0
for a, b in zip(S, S[1:]):
    if a != b:
        ans += 1
print(ans)

S = eval(input())
ans = len([1 for a, b in zip(S, S[1:]) if a != b])
print(ans)

-ans = 0 -for a, b in zip(S, S[1:]): -    if a != b: -        ans += 1 +ans = len([1 for a, b in zip(S, S[1:]) if a != b])