private fun readInts() = readLine()!!.split(" ").map { it.toInt() }

fun main(args: Array<String>) {
    val (N, M, X) = readInts()
    val A = readInts()

    var c = 0
    for (k in (0 + 1) until X) {
        if (A.contains(k)) c += 1
    }

    var d = 0
    for (k in (X + 1) until N) {
        if (A.contains(k)) d += 1
    }

    println(if (c < d) c else d)
}