
object Main extends App {
  val n = scala.io.StdIn.readLine.split(" ").map(_.toInt)
  val Array(a, b) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
  val p = scala.io.StdIn.readLine.split(" ").map(_.toInt).toList

  println(List(p.count(_ <= a), p.count(i => i > a && b <= i), p.count(b < _)).min)
}
