s=eval(input())

a=0

for i in range(len(s)):

      if i%2==0:

            if s[i]=="0":

                  a+=1

      elif s[i]=="1":

            a+=1

print((min(a,len(s)-a)))
s=eval(input())

a=s[::2].count("0")

b=s[1::2].count("1")

a=a+b

print((min(a,len(s)-a)))
s = eval(input())
a = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "0":
            a += 1
    elif s[i] == "1":
        a += 1
print((min(a, len(s) - a)))

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

-a = 0 -for i in range(len(s)): -    if i % 2 == 0: -        if s[i] == "0": -            a += 1 -    elif s[i] == "1": -        a += 1 +a = s[::2].count("0") +b = s[1::2].count("1") +a = a + b