import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  } main {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int M = Integer.parseInt(sc.next()); M Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int X = Integer.parseInt(sc.next()); X Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc boolean[] f = new boolean[N+1]; f new boolean[N+1] N+1 N 1 for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    } {
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    } int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc f[n] = true f[n] f n true int l = 0 l 0 u = 0; u 0 for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    } {
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    } if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      } f[i] f i {
        if(i < X){
          l++;
        }else{
          u++;
        }
      } if(i < X){
          l++;
        }else{
          u++;
        } i < X i X {
          l++;
        } l++ l {
          u++;
        } u++ u System.out.println(Math.min(l,u)) System.out.println System.out System System.out Math.min(l,u) Math.min Math l u String[]args args public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int X = Integer.parseInt(sc.next());
    
    boolean[] f = new boolean[N+1];    
    for(int i = 0; i < M; i++){
      int n = Integer.parseInt(sc.next());
      f[n] = true;
    }
    
    int l = 0, u = 0;
    for(int i = 0; i < N; i++){
      if(f[i]){
        if(i < X){
          l++;
        }else{
          u++;
        }
      }
    }
    System.out.println(Math.min(l,u));
  }
}