S = eval(input())

N = len(S)

even = S[0::2]

odd = S[1::2]

ptn0 = N - (even.count('0') + odd.count('1'))

ptn1 = N - (even.count('1') + odd.count('0'))

print((min(ptn0, ptn1)))
s = eval(input())



even_s = s[1::2]

odd_s = s[::2]



num_1 = even_s.count('1')+odd_s.count('0')

num_2 = even_s.count('0')+odd_s.count('1')



print((min(num_1 , num_2)))
S = eval(input())
N = len(S)
even = S[0::2]
odd = S[1::2]
ptn0 = N - (even.count("0") + odd.count("1"))
ptn1 = N - (even.count("1") + odd.count("0"))
print((min(ptn0, ptn1)))

s = eval(input())
even_s = s[1::2]
odd_s = s[::2]
num_1 = even_s.count("1") + odd_s.count("0")
num_2 = even_s.count("0") + odd_s.count("1")
print((min(num_1, num_2)))

-S = eval(input()) -N = len(S) -even = S[0::2] -odd = S[1::2] -ptn0 = N - (even.count("0") + odd.count("1")) -ptn1 = N - (even.count("1") + odd.count("0")) -print((min(ptn0, ptn1))) +s = eval(input()) +even_s = s[1::2] +odd_s = s[::2] +num_1 = even_s.count("1") + odd_s.count("0") +num_2 = even_s.count("0") + odd_s.count("1") +print((min(num_1, num_2)))