
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	} main {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int N = reader.nextInt(); N reader.nextInt() reader.nextInt reader int M = reader.nextInt(); M reader.nextInt() reader.nextInt reader int X = reader.nextInt(); X reader.nextInt() reader.nextInt reader int[] A = new int[N]; A new int[N] N int ans1 = 0; ans1 0 int ans2 = 0; ans2 0 for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			A[reader.nextInt()] = 1;
		} {
			A[reader.nextInt()] = 1;
		} A[reader.nextInt()] = 1 A[reader.nextInt()] A reader.nextInt() reader.nextInt reader 1 for (int i = X; i < N; i++) {
			ans1 += A[i];
		} int i = X; int i = X; i X i < N i N i++ i++ i {
			ans1 += A[i];
		} {
			ans1 += A[i];
		} ans1 += A[i] ans1 A[i] A i for (int i = X; i > 0; i--) {
			ans2 += A[i];
		} int i = X; int i = X; i X i > 0 i 0 i-- i-- i {
			ans2 += A[i];
		} {
			ans2 += A[i];
		} ans2 += A[i] ans2 A[i] A i System.out.println(Math.min(ans1, ans2)) System.out.println System.out System System.out Math.min(ans1, ans2) Math.min Math ans1 ans2 reader.close() reader.close reader String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int M = reader.nextInt();
		int X = reader.nextInt();
		int[] A = new int[N];
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < M; i++) {
			A[reader.nextInt()] = 1;
		}

		for (int i = X; i < N; i++) {
			ans1 += A[i];
		}
		for (int i = X; i > 0; i--) {
			ans2 += A[i];
		}
		System.out.println(Math.min(ans1, ans2));
		reader.close();
	}
}

