import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc M = sc.nextInt() M sc.nextInt() sc.nextInt sc X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int[] arr = new int[N+1]; arr new int[N+1] N+1 N 1 int[] psa = new int[N+1]; psa new int[N+1] N+1 N 1 for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			int a = sc.nextInt();
			arr[a]++;
		} {
			int a = sc.nextInt();
			arr[a]++;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc arr[a]++ arr[a] arr a for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			psa[i] = psa[i-1] + arr[i];
		} {
			psa[i] = psa[i-1] + arr[i];
		} psa[i] = psa[i-1] + arr[i] psa[i] psa i psa[i-1] + arr[i] psa[i-1] psa i-1 i 1 arr[i] arr i int ans = Math.min(psa[X], psa[N]-psa[X-1]); ans Math.min(psa[X], psa[N]-psa[X-1]) Math.min Math psa[X] psa X psa[N]-psa[X-1] psa[N] psa N psa[X-1] psa X-1 X 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] arr = new int[N+1];
		int[] psa = new int[N+1];
		for(int i=0; i<M; i++) {
			int a = sc.nextInt();
			arr[a]++;
		}
		for(int i=1; i<=N; i++) {
			psa[i] = psa[i-1] + arr[i];
		}
		int ans = Math.min(psa[X], psa[N]-psa[X-1]);
		System.out.println(ans);

		
		
		
		
		
	}

}
