s = eval(input())

res1, res2 = 0, 0

for i, j in enumerate(s):

    if i % 2 == 0:

        if j == '0':

            res1 += 1

    else:

        if j == '1':

            res1 += 1

for i, j in enumerate(s):

    if i % 2 == 1:

        if j == '0':

            res2 += 1

    else:

        if j == '1':

            res2 += 1

print((min(res1, res2)))

s=eval(input())

n=len(s)

a=sum(i%2^int(s[i])for i in range(n))

print((min(a,n-a)))
s = eval(input())
res1, res2 = 0, 0
for i, j in enumerate(s):
    if i % 2 == 0:
        if j == "0":
            res1 += 1
    else:
        if j == "1":
            res1 += 1
for i, j in enumerate(s):
    if i % 2 == 1:
        if j == "0":
            res2 += 1
    else:
        if j == "1":
            res2 += 1
print((min(res1, res2)))

s = eval(input())
n = len(s)
a = sum(i % 2 ^ int(s[i]) for i in range(n))
print((min(a, n - a)))

-res1, res2 = 0, 0 -for i, j in enumerate(s): -    if i % 2 == 0: -        if j == "0": -            res1 += 1 -    else: -        if j == "1": -            res1 += 1 -for i, j in enumerate(s): -    if i % 2 == 1: -        if j == "0": -            res2 += 1 -    else: -        if j == "1": -            res2 += 1 -print((min(res1, res2))) +n = len(s) +a = sum(i % 2 ^ int(s[i]) for i in range(n)) +print((min(a, n - a)))