n = gets.chomp.to_i
a,b = gets.chomp.split.map(&:to_i)
p = gets.chomp.split.map(&:to_i).sort
p_1,p_2,p_3 = [],[],[]
while p.size != 0
if p[0] <= a
  p_1 << p[0]
  p.shift
elsif p[0] > a && p[0] <= b
    p_2 << p[0]
    p.shift
elsif p[0] >= b
    p_3 << p[0]
    p.shift
end
end
puts [p_1.size,p_2.size,p_3.size].min