import java.math.*

fun main(args: Array<String>) {
    val n = Integer.parseInt(readInputLine())
    val (a, b) = readInputLine().split(" ").map { Integer.parseInt(it) }
    
    val ps = mutableListOf<Int>()
    
    val inputs = readInputLine().split(" ").map { Integer.parseInt(it) }
    
    for (i in 0 until n) {
        ps.add(inputs[i])
    }
    
    val aProblem = ps.count { it <= a }
    val bProblem = ps.count { it > a && it <= b }
    val cProblem = ps.count { it > b }
    
    println("${Math.min(aProblem, Math.min(bProblem, cProblem))}")
}
 
fun readInputLine(): String {
    return readLine()!!
}
