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[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	}
} 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[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	} 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[] road= new int[n+1]; road new int[n+1] n+1 n 1 int left=0 left 0 right=0; right 0 for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			int a=sc.nextInt();
			road[a]=1;
		} {
			int a=sc.nextInt();
			road[a]=1;
		} int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc road[a]=1 road[a] road a 1 for(int i=x;0<=i;i--) {
			left+=road[i];
		} int i=x; int i=x; i x 0<=i 0 i i-- i-- i {
			left+=road[i];
		} {
			left+=road[i];
		} left+=road[i] left road[i] road i for(int i=x;i<=n;i++) {
			right+=road[i];
		} int i=x; int i=x; i x i<=n i n i++ i++ i {
			right+=road[i];
		} {
			right+=road[i];
		} right+=road[i] right road[i] road i System.out.println(left<right?left:right) System.out.println System.out System System.out left<right?left:right left<right left right left right 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[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	}
} 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[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	}
} Main
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[] road= new int[n+1];
		int left=0,right=0;

		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			road[a]=1;
		}

		for(int i=x;0<=i;i--) {
			left+=road[i];
		}
		for(int i=x;i<=n;i++) {
			right+=road[i];
		}
		System.out.println(left<right?left:right);

	}
}