fun main(args: Array<String>){
    val n = Integer.parseInt(readLine())
    val input: List<String> = readLine()!!.split(" ")
    val a = Integer.parseInt(input[0])
    val b = Integer.parseInt(input[1])
    val pListInput: List<String> = readLine()!!.split(" ")
    val num = arrayOf(0, 0, 0)
    for (pInput in pListInput){
        val p = Integer.parseInt(pInput)
        when {
            p <= a -> num[0]++
            p <= b -> num[1]++
            else -> num[2]++
        }
    }

    println(num.min())
}