S = eval(input())

tmp1 = '01' * (len(S) // 2 + 1)

tmp2 = '10' * (len(S) // 2 + 1)

C = {0 : 0, 1 : 0}

for i, s in enumerate(S):

    if s != tmp1[i] : C[0] += 1

    if s != tmp2[i] : C[1] += 1

print((min(C.values())))
s = eval(input())

n = s[::2].count('0') + s[1::2].count('1')

print(( min(n, len(s)-n) ))
S = eval(input())
tmp1 = "01" * (len(S) // 2 + 1)
tmp2 = "10" * (len(S) // 2 + 1)
C = {0: 0, 1: 0}
for i, s in enumerate(S):
    if s != tmp1[i]:
        C[0] += 1
    if s != tmp2[i]:
        C[1] += 1
print((min(C.values())))

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

-S = eval(input()) -tmp1 = "01" * (len(S) // 2 + 1) -tmp2 = "10" * (len(S) // 2 + 1) -C = {0: 0, 1: 0} -for i, s in enumerate(S): -    if s != tmp1[i]: -        C[0] += 1 -    if s != tmp2[i]: -        C[1] += 1 -print((min(C.values()))) +s = eval(input()) +n = s[::2].count("0") + s[1::2].count("1") +print((min(n, len(s) - n)))