ary = gets.split('')

odd = ary.each_slice(2).map(&:first)
even = ary.each_slice(2).map(&:last)

count1 = even.count("0") + odd.count("1")
count2 = even.count("1") + odd.count("0")

puts [count1,count2].min