S  = str(eval(input()))

p1 = 0

p2 = 0

for i in range(len(S)):

    if i % 2 == 0:

        if S[i] == '0':

            p1 += 1

        else:

            p2 += 1

    else:

        if S[i] == '0':

            p2 += 1

        else:

            p1 += 1

print((min(p1, p2)))

S  = str(eval(input()))

p1 = 0

for i in range(len(S)):

    if i % 2 == 0:

        if S[i] == '0':

            p1 += 1

    else:

        if S[i] == '1':

            p1 += 1

print((min(p1, len(S) - p1)))

S = str(eval(input()))
p1 = 0
p2 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "0":
            p1 += 1
        else:
            p2 += 1
    else:
        if S[i] == "0":
            p2 += 1
        else:
            p1 += 1
print((min(p1, p2)))

S = str(eval(input()))
p1 = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "0":
            p1 += 1
    else:
        if S[i] == "1":
            p1 += 1
print((min(p1, len(S) - p1)))

-p2 = 0 -        else: -            p2 += 1 -        if S[i] == "0": -            p2 += 1 -        else: +        if S[i] == "1": -print((min(p1, p2))) +print((min(p1, len(S) - p1)))