n = gets.to_i
a, b = gets.split.map(&:to_i)
ps = gets.split.map(&:to_i)

count = [0, 0, 0]
ps.each do |v|
  idx = if v <= a
          0
        elsif v <= b
          1
        else
          2
        end
  count[idx] += 1
end
puts(count.min)