import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int array[] = new int[M]; array new int[M] M for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    } int i=0; int i=0; i 0 i<M i M i++ i++ i {
      array[i] = sc.nextInt();
    } {
      array[i] = sc.nextInt();
    } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int[] cell = new int[N+1]; cell new int[N+1] N+1 N 1 Arrays.fill(cell,0) Arrays.fill Arrays cell 0 for(int i : array){
        cell[i] = 1;
    } int i array {
        cell[i] = 1;
    } {
        cell[i] = 1;
    } cell[i] = 1 cell[i] cell i 1 int cost0 = 0; cost0 0 for(int i=X;i>=0;i--){
      cost0 += cell[i];
    } int i=X; int i=X; i X i>=0 i 0 i-- i-- i {
      cost0 += cell[i];
    } {
      cost0 += cell[i];
    } cost0 += cell[i] cost0 cell[i] cell i int costN = 0; costN 0 for(int i=X;i<N+1;i++){
      costN += cell[i];
    } int i=X; int i=X; i X i<N+1 i N+1 N 1 i++ i++ i {
      costN += cell[i];
    } {
      costN += cell[i];
    } costN += cell[i] costN cell[i] cell i int cost = cost0 <= costN ? cost0 : costN; cost cost0 <= costN ? cost0 : costN cost0 <= costN cost0 costN cost0 costN System.out.println(cost) System.out.println System.out System System.out cost String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int array[] = new int[M];

    for(int i=0;i<M;i++){
      array[i] = sc.nextInt();
    }
    int[] cell = new int[N+1];

    Arrays.fill(cell,0);

    for(int i : array){
        cell[i] = 1;
    }

    int cost0 = 0;
    for(int i=X;i>=0;i--){
      cost0 += cell[i];
    }

    int costN = 0;
    for(int i=X;i<N+1;i++){
      costN += cell[i];
    }

    int cost = cost0 <= costN ? cost0 : costN;
    System.out.println(cost);
    }
}
