tiles = str(input())
size = len(tiles)
one = 0
zero = 0

for i in range(size):
	one_i = (i+1) % 2
	zero_i = i % 2
	one += abs(one_i - int(tiles[i]))
	zero += abs(zero_i - int(tiles[i]))

print(min(one, zero))