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

    val road = (1..N).map { if (A.contains(it)) 1 else 0 }.toList()
    val leftCost = (0 until X).map { road[it] }.sum()
    val rightCost = (X until N).map { road[it] }.sum()
    
    println(Math.min(leftCost, rightCost))
}