l = [int(i) for i in list(eval(input()))]



even = l[0::2]

odd = l[1::2]



l = sum([abs(1-x) for x in even]) + sum(odd)

r = sum([abs(1-x) for x in odd]) + sum(even)



print((min(l, r)))
s = [int(i) for i in eval(input())]

n = len(s)



l = sum(s[0::2])

r = sum(s[1::2])



print((min(abs(l-r+len(s[1::2])), abs(r-l+len(s[0::2])))))
l = [int(i) for i in list(eval(input()))]
even = l[0::2]
odd = l[1::2]
l = sum([abs(1 - x) for x in even]) + sum(odd)
r = sum([abs(1 - x) for x in odd]) + sum(even)
print((min(l, r)))

s = [int(i) for i in eval(input())]
n = len(s)
l = sum(s[0::2])
r = sum(s[1::2])
print((min(abs(l - r + len(s[1::2])), abs(r - l + len(s[0::2])))))

-l = [int(i) for i in list(eval(input()))] -even = l[0::2] -odd = l[1::2] -l = sum([abs(1 - x) for x in even]) + sum(odd) -r = sum([abs(1 - x) for x in odd]) + sum(even) -print((min(l, r))) +s = [int(i) for i in eval(input())] +n = len(s) +l = sum(s[0::2]) +r = sum(s[1::2]) +print((min(abs(l - r + len(s[1::2])), abs(r - l + len(s[0::2])))))