S = eval(input())

d,m = len(S)//2,len(S)%2

A = '01'*d+'0'*m

B = '10'*d+'1'*m

count_a = 0

count_b = 0

for s,a,b in zip(S,A,B):

    if s != a:

        count_a += 1

    if s != b:

        count_b += 1

print((min(count_a, count_b)))
s = eval(input())

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

print((min(h, len(s)-h)))
S = eval(input())
d, m = len(S) // 2, len(S) % 2
A = "01" * d + "0" * m
B = "10" * d + "1" * m
count_a = 0
count_b = 0
for s, a, b in zip(S, A, B):
    if s != a:
        count_a += 1
    if s != b:
        count_b += 1
print((min(count_a, count_b)))

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

-S = eval(input()) -d, m = len(S) // 2, len(S) % 2 -A = "01" * d + "0" * m -B = "10" * d + "1" * m -count_a = 0 -count_b = 0 -for s, a, b in zip(S, A, B): -    if s != a: -        count_a += 1 -    if s != b: -        count_b += 1 -print((min(count_a, count_b))) +s = eval(input()) +h = s[::2].count("1") + s[1::2].count("0") +print((min(h, len(s) - h)))