S = list(eval(input()))

ans = 0



if len(S) > 1:

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

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

            if S[i+1] == "0":

                S[i+1] = "1"

                ans += 1

            else:

                S[i+1] = "0"

                ans += 1

    print(ans)

else:

    print((0))

S = list(eval(input()))



before_tile = S[0]



ans = 0

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

    if S[i] == before_tile:

        ans += 1

        if S[i] == "0":

            S[i] = "1"

        else:

            S[i] = "0"

    before_tile = S[i]



print(ans)

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

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

+before_tile = S[0] -if len(S) > 1: -    for i in range(len(S) - 1): -        if S[i] == S[i + 1]: -            if S[i + 1] == "0": -                S[i + 1] = "1" -                ans += 1 -            else: -                S[i + 1] = "0" -                ans += 1 -    print(ans) -else: -    print((0)) +for i in range(1, len(S)): +    if S[i] == before_tile: +        ans += 1 +        if S[i] == "0": +            S[i] = "1" +        else: +            S[i] = "0" +    before_tile = S[i] +print(ans)