import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    } main {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    } 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 A[] =new int[N+1]; A new int[N+1] N+1 N 1 int num1=0; num1 0 int num2=0; num2 0 int m; m for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        } int i=1; int i=1; i 1 i<=M i M i++ i++ i {
            
            m=sc.nextInt();
            A[m]=1;
            
        } {
            
            m=sc.nextInt();
            A[m]=1;
            
        } m=sc.nextInt() m sc.nextInt() sc.nextInt sc A[m]=1 A[m] A m 1 for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        } int i=X; int i=X; i X i>=0 i 0 i-- i-- i {
            
            num1+=A[i];
            
        } {
            
            num1+=A[i];
            
        } num1+=A[i] num1 A[i] A i for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        } int i=X; int i=X; i X i<=N i N i++ i++ i {
            
            num2+=A[i];
            
        } {
            
            num2+=A[i];
            
        } num2+=A[i] num2 A[i] A i int min_num = Math.min(num1, num2); min_num Math.min(num1, num2) Math.min Math num1 num2 System.out.println(min_num) System.out.println System.out System System.out min_num String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int A[] =new int[N+1];
        
        int num1=0;
        int num2=0;
        int m;
        
        for(int i=1;i<=M;i++){
            
            m=sc.nextInt();
            A[m]=1;
            
        }
        for(int i=X;i>=0;i--){
            
            num1+=A[i];
            
        }
        for(int i=X;i<=N;i++){
            
            num2+=A[i];
            
        }
        int min_num = Math.min(num1, num2);
        
        System.out.println(min_num);
        
    }
}
