n = gets.to_i
a, b = gets.split(" ").map(&:to_i)
array = gets.split(" ").map(&:to_i)

first = array.select{|item| item <= a}
second = array.select{|item| item >= a + 1 && item <= b}
third = array.select{|item| item >= b +1}

# p first
# p second
# p third

ans = [first.length, second.length, third.length].min
puts ans