import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N, M, X = sc.nextInt
  val A = Array.fill(M)(sc.nextInt)

  val a = (0 to X).count(A.contains(_))
  val b = (X to N).count(A.contains(_))

  println(math.min(a, b))
}
