s = gets.chomp

a = b = 0
s.chars.each_with_index do |c, i|
  if i.even?
    a += 1 if c == '0'
    b += 1 if c == '1'
  elsif i.odd?
    a += 1 if c == '1'
    b += 1 if c == '0'
  end
end

puts [a, b].min