N = gets.to_i
A, B = gets.split.map(&:to_i)
ps = gets.split.map(&:to_i)

num = [0, 0, 0]
ps.each do |p|
    if p <= A
        num[0] += 1
    elsif p <= B
        num[1] += 1
    else
        num[2] += 1
    end
end
puts num.min