N = gets.to_i
A,B = gets.split.map(&:to_i)
array = gets.split.map(&:to_i)
first = []
second = []
third = []
array.each{|x|
  if x <= A
    first << x
  elsif x > A && x <= B
    second << x
  elsif x > B
    third << x
  end
}
size = [first.size,second.size,third.size]
puts size.min
