object Main extends App {

  import scala.io.StdIn._
  val n = readLine.trim.toInt
  val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
  val points = readLine.trim.split(' ').map(_.toInt).toList
  println(calMax(points))
  def calMax(points: List[Int]): Int = {
    val canBeFirst = points.count(_ <= a)
    val canBeSecond = points.count(i ⇒ a < i && i <= b)
    val canBeThird = points.count(_ > b)
    List(canBeFirst, canBeSecond, canBeThird).min
  }
  implicit class Extension[T](value :T){
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}