fun main(args: Array<String>) {
    val (N,M,X) = readLine()!!.split(" ").map { it.toInt() }
    val As = readLine()!!.split(" ").map { it.toInt() }

    val a0 = As.filter { it < X }.size
    val aN = As.filter { it > X }.size

    println(listOf(a0,aN).min())
}