raw = eval(input())

s = bin(int(raw, 2))

n = len(raw)

m = bin(int(''.join([str(i%2) for i in range(n)]),2))

 

a = bin((int(s,2))^int(m,2)).count("1")

b = n-a

 

print((a if a < b else b))
s = list(eval(input()))



print((min(s[::2].count('0')+s[1::2].count('1'), s[::2].count('1')+s[1::2].count('0'))))

raw = eval(input())
s = bin(int(raw, 2))
n = len(raw)
m = bin(int("".join([str(i % 2) for i in range(n)]), 2))
a = bin((int(s, 2)) ^ int(m, 2)).count("1")
b = n - a
print((a if a < b else b))

s = list(eval(input()))
print(
    (
        min(
            s[::2].count("0") + s[1::2].count("1"),
            s[::2].count("1") + s[1::2].count("0"),
        )
    )
)

-raw = eval(input()) -s = bin(int(raw, 2)) -n = len(raw) -m = bin(int("".join([str(i % 2) for i in range(n)]), 2)) -a = bin((int(s, 2)) ^ int(m, 2)).count("1") -b = n - a -print((a if a < b else b)) +s = list(eval(input())) +print( +    ( +        min( +            s[::2].count("0") + s[1::2].count("1"), +            s[::2].count("1") + s[1::2].count("0"), +        ) +    ) +)