n = gets.to_i
a, b = gets.split.map{|i|i.to_i}
p = gets.split.map{|i|i.to_i}

first, second, third = 0, 0, 0

p.each do |score|
  if score <= a
    first+=1
  elsif score <= b
    second+=1
  else
    third+=1
  end
end

puts [first, second, third].min