n = gets.to_i
a,b = gets.split.map(&:to_i)
point = gets.split.map(&:to_i)
prob = [0,0,0]
(point.length).times{|i|
  if point[i] <= a
    prob[0] += 1
  elsif point[i] <= b
    prob[1] += 1
  else
    prob[2] += 1
  end}
prob.sort!
puts prob[0]
