s = gets.chomp

b = 0 # start with black(0)
w = 0 # start with white(1)

s.each_char.map(&:to_i).each_with_index do |c,i|
    if i%2 == 0
        # b->0, w->1
        if c == 0
            w += 1 
        else
            b += 1
        end
    else
        if c == 0
            b += 1
        else
            w += 1
        end
    end
end

puts [b,w].min
