s = gets.chomp.split("").map(&:to_i)

zi=0
oi=0

(0..s.count-1).each do |i|
  if i.even?
    if s[i] == 1
      zi += 1
    else
      oi += 1
    end
  else
    if s[i] == 0
      zi += 1
    else
      oi += 1
    end
  end
end

if zi <= oi
  puts zi
else
  puts oi
end