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

set_1 = P.select do |p|
  p <= A
end
set_2 = P.select do |p|
  p > A && p <= B
end
set_3 = P.select do |p|
  p > B
end

puts [set_1.size, set_2.size, set_3.size].min