S = list(eval(input()))

# min(全部０１０１０、全部１０１０１)

cnt0 = 0

cnt1 = 0

for e in S[::2]:

    if e == '1':

        cnt0 += 1

for e in S[1::2]:

    if e == '0':

        cnt0 += 1

for e in S[::2]:

    if e == '0':

        cnt1 += 1

for e in S[1::2]:

    if e == '1':

        cnt1 += 1

print((min(cnt0, cnt1)))

S = list(eval(input()))

# min(全部０１０１０、全部１０１０１)

cnt0 = 0

cnt1 = 0

for e in S[::2]:

    if e == '1':

        cnt0 += 1

    else:

        cnt1 += 1

for e in S[1::2]:

    if e == '0':

        cnt0 += 1

    else:

        cnt1 += 1

print((min(cnt0, cnt1)))

S = list(eval(input()))
# min(全部０１０１０、全部１０１０１)
cnt0 = 0
cnt1 = 0
for e in S[::2]:
    if e == "1":
        cnt0 += 1
for e in S[1::2]:
    if e == "0":
        cnt0 += 1
for e in S[::2]:
    if e == "0":
        cnt1 += 1
for e in S[1::2]:
    if e == "1":
        cnt1 += 1
print((min(cnt0, cnt1)))

S = list(eval(input()))
# min(全部０１０１０、全部１０１０１)
cnt0 = 0
cnt1 = 0
for e in S[::2]:
    if e == "1":
        cnt0 += 1
    else:
        cnt1 += 1
for e in S[1::2]:
    if e == "0":
        cnt0 += 1
    else:
        cnt1 += 1
print((min(cnt0, cnt1)))

+    else: +        cnt1 += 1 -for e in S[::2]: -    if e == "0": -        cnt1 += 1 -for e in S[1::2]: -    if e == "1": +    else: