import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  }

} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int X = scanner.nextInt(); X scanner.nextInt() scanner.nextInt scanner int A[] = new int[N + 1]; A new int[N + 1] N + 1 N 1 for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    } int i = 1; int i = 1; i 1 i <= M i M i++ i++ i {
      A[scanner.nextInt()] = 1;
    } {
      A[scanner.nextInt()] = 1;
    } A[scanner.nextInt()] = 1 A[scanner.nextInt()] A scanner.nextInt() scanner.nextInt scanner 1 int to0 = 0; to0 0 for (int i = 0; i < X; i++) {
      to0 += A[i];
    } int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
      to0 += A[i];
    } {
      to0 += A[i];
    } to0 += A[i] to0 A[i] A i int toN = 0; toN 0 for (int i = X; i < N; i++) {
      toN += A[i];
    } int i = X; int i = X; i X i < N i N i++ i++ i {
      toN += A[i];
    } {
      toN += A[i];
    } toN += A[i] toN A[i] A i if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    } to0 > toN to0 toN {
      System.out.println(toN);
    } System.out.println(toN) System.out.println System.out System System.out toN {
      System.out.println(to0);
    } System.out.println(to0) System.out.println System.out System System.out to0 String[] args args public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  }

} public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int X = scanner.nextInt();

    int A[] = new int[N + 1];

    for (int i = 1; i <= M; i++) {
      A[scanner.nextInt()] = 1;
    }

    int to0 = 0;
    for (int i = 0; i < X; i++) {
      to0 += A[i];
    }
    int toN = 0;
    for (int i = X; i < N; i++) {
      toN += A[i];
    }
    if (to0 > toN) {
      System.out.println(toN);
    } else {
      System.out.println(to0);
    }

  }

}
