S = list(eval(input()))

flag = S[0]

flag_num = 0

ans = 0





for i in range(len(S)):

    if flag != S[flag_num]:

        ans += 1

        flag = S[flag_num]

    

    flag_num += 1

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

now = S[0]

ans = 0

for i in S:

    if now != i:

        ans += 1

        now = i

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

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

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