n = gets.chomp.to_i
a, b = gets.chomp.split.map(&:to_i)
ary = gets.chomp.split.map(&:to_i)
count1 = 0
count2 = 0
count3 = 0

ary.each do |item|
    if a >= item
        count1 += 1
    elsif b >= item
        count2 += 1
    else
        count3 += 1
    end
end
ans = [count1,count2, count3]
puts ans.sort![0]