s = STDIN.gets.chomp.split("")
if s.size == 1
  puts 0
  exit
end

diff1 = 0
diff2 = 0

cnt = 0
s.each{|c|
  if (cnt & 1) == 0
    if c != "0"
      diff1 += 1
    else
      diff2 += 1
    end
  else
    if c != "1"
      diff1 += 1
    else
      diff2 += 1
    end
  end
  }

if diff1 < diff2
  puts diff1
else
  puts diff2
end