s=eval(input())

n=len(s)

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

print((min(a,n-a)))
*s,=list(map(int,eval(input())))

n=len(s)

a=sum(s[::2])+n//2-sum(s[1::2])

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

(*s,) = list(map(int, eval(input())))
n = len(s)
a = sum(s[::2]) + n // 2 - sum(s[1::2])
print((min(a, n - a)))

-s = eval(input()) +(*s,) = list(map(int, eval(input()))) -a = sum(i % 2 ^ int(s[i]) for i in range(n)) +a = sum(s[::2]) + n // 2 - sum(s[1::2])