n = gets.to_i
a, b = gets.split(' ')
a = a.to_i
b = b.to_i
points = gets.split(' ').map(&:to_i)

first = 
  points.map{ |point|point if point <= a }.compact.count
second = 
  points.map{ |point|point if point >= (a + 1) && point <= b }.compact.count
third = 
  points.map{ |point|point if point >= (b + 1) }.compact.count

puts [first, second, third].min
