S = list(eval(input()))

now = S[0]

ans = 0

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

    if now != S[i]:

        ans += 1

        now = S[i]

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

now = S[0]

ans = 0

for stone in S:

    if stone != now:

        now = stone

        ans += 1

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

S = eval(input())
now = S[0]
ans = 0
for stone in S:
    if stone != now:
        now = stone
        ans += 1
print(ans)

-S = list(eval(input())) +S = eval(input()) -for i in range(1, len(S)): -    if now != S[i]: +for stone in S: +    if stone != now: +        now = stone -        now = S[i]