s=eval(input())



s = list(s)



count = 0



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

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

        count += 1

    

print(count)
S = list(eval(input()))

ans = 0



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

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

        ans += 1

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

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

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