def main(n):

	odd = "1"

	even= "0"

	if(n[0] =="0"):

		# zero mode

		odd = "0"

		even= "1"

	a = sum((((i % 2 != 0) and n[i] == odd)) for i in range(1, len(n),2))

	b = sum((((i % 2 == 0) and n[i] == even)) for i in range(0, len(n),2))

	return a+b



print((main(eval(input()))))
n=eval(input())

r=n[0::2].count("0")+n[1::2].count("1")

print((min(r,len(n)-r)))
def main(n):
    odd = "1"
    even = "0"
    if n[0] == "0":
        # zero mode
        odd = "0"
        even = "1"
    a = sum((((i % 2 != 0) and n[i] == odd)) for i in range(1, len(n), 2))
    b = sum((((i % 2 == 0) and n[i] == even)) for i in range(0, len(n), 2))
    return a + b


print((main(eval(input()))))

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

-def main(n): -    odd = "1" -    even = "0" -    if n[0] == "0": -        # zero mode -        odd = "0" -        even = "1" -    a = sum((((i % 2 != 0) and n[i] == odd)) for i in range(1, len(n), 2)) -    b = sum((((i % 2 == 0) and n[i] == even)) for i in range(0, len(n), 2)) -    return a + b - - -print((main(eval(input())))) +n = eval(input()) +r = n[0::2].count("0") + n[1::2].count("1") +print((min(r, len(n) - r)))