object Main extends App {
	val Array(n, m, x) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	val a = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	val test = new Array[Int](n+1)

	for(x<-a){
		test(x) = 1
	}

	var left = 0
	var right = 0


	for(i<-0 until x){
		left += test(i)
	}

	for(i<-x to n){
		right += test(i)
	}

	println(math.min(left, right))

}