import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    } main {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    } 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 boolean booleans[]=new boolean[N+1]; booleans new boolean[N+1] N+1 N 1 for(int i=0;i<=N;i++){
            booleans[i]=false;
        } int i=0; int i=0; i 0 i<=N i N i++ i++ i {
            booleans[i]=false;
        } {
            booleans[i]=false;
        } booleans[i]=false booleans[i] booleans i false for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            booleans[scanner.nextInt()]=true;
        } {
            booleans[scanner.nextInt()]=true;
        } booleans[scanner.nextInt()]=true booleans[scanner.nextInt()] booleans scanner.nextInt() scanner.nextInt scanner true int a=0; a 0 int b=0; b 0 for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        } int i=1; int i=1; i 1 i<X i X i++ i++ i {
            if(booleans[i]) a++;
        } {
            if(booleans[i]) a++;
        } if(booleans[i]) a++; booleans[i] booleans i a++ a for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        } int i=X+1; int i=X+1; i X+1 X 1 i<N i N i++ i++ i {
            if(booleans[i]) b++;
        } {
            if(booleans[i]) b++;
        } if(booleans[i]) b++; booleans[i] booleans i b++ b System.out.println(Math.min(a,b)) System.out.println System.out System System.out Math.min(a,b) Math.min Math a b String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int M=scanner.nextInt();
        int X=scanner.nextInt();
        boolean booleans[]=new boolean[N+1];
        for(int i=0;i<=N;i++){
            booleans[i]=false;
        }
        for(int i=0;i<M;i++){
            booleans[scanner.nextInt()]=true;
        }
        int a=0;
        int b=0;
        for(int i=1;i<X;i++){
            if(booleans[i]) a++;
        }
        for(int i=X+1;i<N;i++){
            if(booleans[i]) b++;
        }
        System.out.println(Math.min(a,b));
    }
}
