import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val a = sc.nextInt()
    val b = sc.nextInt()
    val p = (1..n).map {
        val P = sc.nextInt()
        when {
            P <= a -> "A"
            P <= b -> "B"
            else -> "C"
        }
    }
    val countA = p.count{it == "A"}
    val countB = p.count{it == "B"}
    val countC = p.count{it == "C"}
    println(Math.min(countA, Math.min(countB, countC)))
}