n = gets.to_i
a,b = gets.split.map(&:to_i)
p = gets.split.map(&:to_i)
c = [0,0,0]
n.times do |i|
    if p[i] <= a
        c[0] += 1
    elsif p[i] <= b
        c[1] += 1
    else
        c[2] += 1
    end
end
puts c.min