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

list1 = point_list.select { |n| n <= a }
list2 = point_list.select { |n| a + 1 <= n && n <= b }
list3 = point_list.select { |n| b + 1 <= n }

puts [list1.size, list2.size, list3.size].min
