private fun readInts() = readLine()!!.split(" ").map { it.toInt() }

fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val (A, B) = readInts()
    var P = readInts().sorted()

    val first = P.filter { it <= A }
    P = P.filterNot { it <= A }

    val second = P.filter { it in (A + 1)..B }
    P = P.filterNot { it in (A + 1)..B }

    val third = P.filter { it >= B + 1 }

    println(Math.min(Math.min(first.count(), second.count()), third.count()))
}