N = gets.to_i
A, B = gets.split(' ').map(&:to_i)
scores = gets.chomp.split(' ').map(&:to_i)

first = scores.select{|n| n <= A}.count
second = scores.select{|n| n > A && n <= B}.count
third = scores.select{|n| n > B}.count

puts [first, second, third].min