h = gets.split("").map(&:to_i)
n = h.size - 1


ans_01 = 0
ans_10 = 0

n.times do |i|
  if i % 2 == 0
    if h[i] == 0
      ans_10 += 1
    else
      ans_01 += 1
    end
  else
    if h[i] == 1
      ans_10 += 1
    else
      ans_01 += 1
    end
  end
end

puts [ans_10, ans_01].min
