s = gets.chomp
odds = []
evens = []
s.length.times do |n|
  if n.odd?
    odds.push(s[n])
  elsif n.even?
    evens.push(s[n])
  end
end

def count(list)
  res = [0, 0] #0, 1
  list.each do |n|
    if n == "0"
      res[0] += 1
    else
      res[1] += 1
    end
  end
  res
end

even_res = count(evens)
odd_res = count(odds)

puts [even_res[0] + odd_res[1], even_res[1] + odd_res[0]].min