object Main extends App {
  val n = readLine.toInt
  val (a, b) = readLine.split(" ").map(_.toInt) match {
    case Array(a, b) => (a, b)
  }
  val ps: Seq[Int] = readLine.split(" ").map(_.toInt).toSeq

  val firstCounts = ps.count(_ <= a)
  val secondCounts = ps.count(p => p > a && p <= b)
  val thirdCounts = ps.count(_ > b)

  println(Seq(firstCounts, secondCounts, thirdCounts).min)
}
