S = eval(input())

ans = [0, 0]



for i in range(len(S)):

    if (i % 2 == int(S[i])):

        ans[0] += 1

    if (i % 2 != int(S[i])):

        ans[1] += 1



    

print((min(ans)))

S = list(map(int, eval(input())))

ans = [0, 0]



for i in range(len(S)):

    if (i % 2 == S[i]):

        ans[0] += 1

    if (i % 2 != S[i]):

        ans[1] += 1



print((min(ans)))

S = eval(input())
ans = [0, 0]
for i in range(len(S)):
    if i % 2 == int(S[i]):
        ans[0] += 1
    if i % 2 != int(S[i]):
        ans[1] += 1
print((min(ans)))

S = list(map(int, eval(input())))
ans = [0, 0]
for i in range(len(S)):
    if i % 2 == S[i]:
        ans[0] += 1
    if i % 2 != S[i]:
        ans[1] += 1
print((min(ans)))

-S = eval(input()) +S = list(map(int, eval(input()))) -    if i % 2 == int(S[i]): +    if i % 2 == S[i]: -    if i % 2 != int(S[i]): +    if i % 2 != S[i]: