import java.util.*;

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

      int a = scan.nextInt();
      int b = scan.nextInt();
      int X = scan.nextInt();

      int[] arr = new int[a + 1];
      int   u, count = 0;
      int   abs, sum = 0;
      for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          }
      for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          }

      for(int i = 0; i < X; i++){
          sum += arr[i];
          }
      //if(sum >= 1){
        // sum -= 1;
         //}

      for(int i = X; i < a + 1; i++){
          count += arr[i];
          }
     // count -= 1;


      System.out.println(Math.min(sum, count));
   }
} import java.util.*; util.* java class Main {
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int a = scan.nextInt();
      int b = scan.nextInt();
      int X = scan.nextInt();

      int[] arr = new int[a + 1];
      int   u, count = 0;
      int   abs, sum = 0;
      for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          }
      for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          }

      for(int i = 0; i < X; i++){
          sum += arr[i];
          }
      //if(sum >= 1){
        // sum -= 1;
         //}

      for(int i = X; i < a + 1; i++){
          count += arr[i];
          }
     // count -= 1;


      System.out.println(Math.min(sum, count));
   }
} Main public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      int a = scan.nextInt();
      int b = scan.nextInt();
      int X = scan.nextInt();

      int[] arr = new int[a + 1];
      int   u, count = 0;
      int   abs, sum = 0;
      for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          }
      for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          }

      for(int i = 0; i < X; i++){
          sum += arr[i];
          }
      //if(sum >= 1){
        // sum -= 1;
         //}

      for(int i = X; i < a + 1; i++){
          count += arr[i];
          }
     // count -= 1;


      System.out.println(Math.min(sum, count));
   } main {
      Scanner scan = new Scanner(System.in);

      int a = scan.nextInt();
      int b = scan.nextInt();
      int X = scan.nextInt();

      int[] arr = new int[a + 1];
      int   u, count = 0;
      int   abs, sum = 0;
      for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          }
      for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          }

      for(int i = 0; i < X; i++){
          sum += arr[i];
          }
      //if(sum >= 1){
        // sum -= 1;
         //}

      for(int i = X; i < a + 1; i++){
          count += arr[i];
          }
     // count -= 1;


      System.out.println(Math.min(sum, count));
   } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int[] arr = new int[a + 1]; arr new int[a + 1] a + 1 a 1 int   u u count = 0; count 0 int   abs abs sum = 0; sum 0 for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          } int i = 0; int i = 0; i 0 i < a + 1 i a + 1 a 1 i++ i++ i {
          arr[i] = 0;
          } {
          arr[i] = 0;
          } arr[i] = 0 arr[i] arr i 0 for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          } int i = 0; int i = 0; i 0 i < b i b i++ i++ i {
          u      = scan.nextInt();
          arr[u] = 1;
          } {
          u      = scan.nextInt();
          arr[u] = 1;
          } u      = scan.nextInt() u scan.nextInt() scan.nextInt scan arr[u] = 1 arr[u] arr u 1 for(int i = 0; i < X; i++){
          sum += arr[i];
          } int i = 0; int i = 0; i 0 i < X i X i++ i++ i {
          sum += arr[i];
          } {
          sum += arr[i];
          } sum += arr[i] sum arr[i] arr i for(int i = X; i < a + 1; i++){
          count += arr[i];
          } int i = X; int i = X; i X i < a + 1 i a + 1 a 1 i++ i++ i {
          count += arr[i];
          } {
          count += arr[i];
          } count += arr[i] count arr[i] arr i System.out.println(Math.min(sum, count)) System.out.println System.out System System.out Math.min(sum, count) Math.min Math sum count String[] args args
import java.util.*;

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

      int a = scan.nextInt();
      int b = scan.nextInt();
      int X = scan.nextInt();

      int[] arr = new int[a + 1];
      int   u, count = 0;
      int   abs, sum = 0;
      for(int i = 0; i < a + 1; i++){
          arr[i] = 0;
          }
      for(int i = 0; i < b; i++){
          u      = scan.nextInt();
          arr[u] = 1;
          }

      for(int i = 0; i < X; i++){
          sum += arr[i];
          }
      //if(sum >= 1){
        // sum -= 1;
         //}

      for(int i = X; i < a + 1; i++){
          count += arr[i];
          }
     // count -= 1;


      System.out.println(Math.min(sum, count));
   }
}
