s = gets.chomp.split("")
count = 0
all = 0
s.each_with_index do |item,j|
        if j % 2 == 1 && item == "0"
            count += 1
        elsif j % 2 == 0 && item == "1"
            count += 1
        end
        if j % 2 == 1 && item == "1"
            all += 1
        elsif j % 2 == 0 && item == "0"
            all += 1
        end
end
puts [count,all].min