s = list(map(int, list(eval(input()))))

e = [i % 2 for i in range(len(s))]

o = [(i+1) % 2 for i in range(len(s))]

print((min(sum(x != y for x, y in zip(s, e)), sum(x != y for x, y in zip(s, o)))))

s = eval(input())

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

print((min(n, len(s)-n)))
s = list(map(int, list(eval(input()))))
e = [i % 2 for i in range(len(s))]
o = [(i + 1) % 2 for i in range(len(s))]
print((min(sum(x != y for x, y in zip(s, e)), sum(x != y for x, y in zip(s, o)))))

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

-s = list(map(int, list(eval(input())))) -e = [i % 2 for i in range(len(s))] -o = [(i + 1) % 2 for i in range(len(s))] -print((min(sum(x != y for x, y in zip(s, e)), sum(x != y for x, y in zip(s, o))))) +s = eval(input()) +n = s[::2].count("0") + s[1::2].count("1") +print((min(n, len(s) - n)))