s = gets.split.map(&:to_i)


def switch_tile(n)
    n == 0 ? 1 : 0
end

def diff_cnt(left_array, right_array)
    unmatch = 0
    match = 0
    left_array.each_with_index do |i, idx|
        if left_array[idx] != right_array[idx]
          unmatch +=1
        else
          match+=1
        end
    end
    return match, unmatch
end

def generate_tiles(l, first_zero = true)
    current = 1
    current = 0 if first_zero
    res = []
    l.times do 
        res.push(current.to_s)
        current = (current + 1) % 2
    end
    return res
end

cand_a = generate_tiles(s.size, false)

match, unmatch = diff_cnt(cand_a, s)

puts [match, unmatch].min
