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

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

    val toZero = (1..X).filter { A.contains(it) }.size
    val toX = (X..N).filter { A.contains(it) }.size

    println(Math.min(toZero, toX))
}