tile_num_array = gets.split("").map(&:to_i)
count = 0
tile_num_array.pop

tile_num_array.each_with_index{|num, index|
  target_bit = 0
  if index % 2 == 0
    target_bit = 0
  else
    target_bit = 1
  end

  if target_bit != num
    count += 1
  end
}

if (tile_num_array.length - count) > count
  answer = count
else
  answer = tile_num_array.length - count
end

puts answer
