fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val (a, b) = readLine()!!.split(" ").map{ it.toInt() }
    val pp = readLine()!!.split(" ").map{ it.toInt() }

    val first = pp.count { it <= a }
    val second = pp.count { it in (a + 1)..b }
    val third = pp.count { it > b }

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