import java.util.*;

class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int c[] = new int[N+1];

		for(int k=0;k<N+1;k++){
			c[k] = 0;
		}
		for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		}

		int up=0;
		int down=0;

		for(int n=0;n<X;n++){
			down += c[n];
		}
		for(int n=X+1;n<N+1;n++){
			up += c[n];
		}

		System.out.println(Math.min(down,up));


	}
} import java.util.*; util.* java class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int c[] = new int[N+1];

		for(int k=0;k<N+1;k++){
			c[k] = 0;
		}
		for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		}

		int up=0;
		int down=0;

		for(int n=0;n<X;n++){
			down += c[n];
		}
		for(int n=X+1;n<N+1;n++){
			up += c[n];
		}

		System.out.println(Math.min(down,up));


	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int c[] = new int[N+1];

		for(int k=0;k<N+1;k++){
			c[k] = 0;
		}
		for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		}

		int up=0;
		int down=0;

		for(int n=0;n<X;n++){
			down += c[n];
		}
		for(int n=X+1;n<N+1;n++){
			up += c[n];
		}

		System.out.println(Math.min(down,up));


	} main {

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int c[] = new int[N+1];

		for(int k=0;k<N+1;k++){
			c[k] = 0;
		}
		for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		}

		int up=0;
		int down=0;

		for(int n=0;n<X;n++){
			down += c[n];
		}
		for(int n=X+1;n<N+1;n++){
			up += c[n];
		}

		System.out.println(Math.min(down,up));


	} 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 c[] = new int[N+1]; c new int[N+1] N+1 N 1 for(int k=0;k<N+1;k++){
			c[k] = 0;
		} int k=0; int k=0; k 0 k<N+1 k N+1 N 1 k++ k++ k {
			c[k] = 0;
		} {
			c[k] = 0;
		} c[k] = 0 c[k] c k 0 for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		} int n=0; int n=0; n 0 n<M n M n++ n++ n {
			int t = sc.nextInt();
			c[t] = 1;
		} {
			int t = sc.nextInt();
			c[t] = 1;
		} int t = sc.nextInt(); t sc.nextInt() sc.nextInt sc c[t] = 1 c[t] c t 1 int up=0; up 0 int down=0; down 0 for(int n=0;n<X;n++){
			down += c[n];
		} int n=0; int n=0; n 0 n<X n X n++ n++ n {
			down += c[n];
		} {
			down += c[n];
		} down += c[n] down c[n] c n for(int n=X+1;n<N+1;n++){
			up += c[n];
		} int n=X+1; int n=X+1; n X+1 X 1 n<N+1 n N+1 N 1 n++ n++ n {
			up += c[n];
		} {
			up += c[n];
		} up += c[n] up c[n] c n System.out.println(Math.min(down,up)) System.out.println System.out System System.out Math.min(down,up) Math.min Math down up String args[] args
import java.util.*;

class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int c[] = new int[N+1];

		for(int k=0;k<N+1;k++){
			c[k] = 0;
		}
		for(int n=0;n<M;n++){
			int t = sc.nextInt();
			c[t] = 1;
		}

		int up=0;
		int down=0;

		for(int n=0;n<X;n++){
			down += c[n];
		}
		for(int n=X+1;n<N+1;n++){
			up += c[n];
		}

		System.out.println(Math.min(down,up));


	}
}