import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	} 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 int a[] = new int[n + 1]; a new int[n + 1] n + 1 n 1 for (int i = 0; i < m; i++) {
			a[scanner.nextInt()] = 1;
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			a[scanner.nextInt()] = 1;
		} {
			a[scanner.nextInt()] = 1;
		} a[scanner.nextInt()] = 1 a[scanner.nextInt()] a scanner.nextInt() scanner.nextInt scanner 1 int left = 0; left 0 for (int i = 0; i <= x; i++) {
			left += a[i];
		} int i = 0; int i = 0; i 0 i <= x i x i++ i++ i {
			left += a[i];
		} {
			left += a[i];
		} left += a[i] left a[i] a i int right = 0; right 0 for (int i = x; i <= n; i++) {
			right += a[i];
		} int i = x; int i = x; i x i <= n i n i++ i++ i {
			right += a[i];
		} {
			right += a[i];
		} right += a[i] right a[i] a i System.out.println(Math.min(left, right)) System.out.println System.out System System.out Math.min(left, right) Math.min Math left right String args[] args public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	}
} Main
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int a[] = new int[n + 1];

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

		int left = 0;
		for (int i = 0; i <= x; i++) {
			left += a[i];
		}

		int right = 0;
		for (int i = x; i <= n; i++) {
			right += a[i];
		}

		System.out.println(Math.min(left, right));
	}
}
