n = gets.chomp.to_i
a, b = gets.chomp.split.map(&:to_i)
probs = gets.chomp.split.map(&:to_i).sort

count1 = probs.select{|prob| prob <= a}.count
count2 = probs.select{|prob| a < prob && prob <= b}.count
count3 = probs.select{|prob| b < prob}.count

puts [count1, count2, count3].min
