import 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[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	}

} import java.util.*; util.* java 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[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt(), X = sc.nextInt();
		int[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	} 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[] A = new int[M]; A new int[M] M for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int costA = 0; costA 0 int costB = 0; costB 0 for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		} int i=X; int i=X; i X i<N i N i++ i++ i {
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		} {
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		} for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			} int j=0; int j=0; j 0 j<M j M j++ j++ j {
				if (i==A[j]){
					costA++;
				}
			} {
				if (i==A[j]){
					costA++;
				}
			} if (i==A[j]){
					costA++;
				} i==A[j] i A[j] A j {
					costA++;
				} costA++ costA for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		} int i=X; int i=X; i X i>0 i 0 i-- i-- i {
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		} {
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		} for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			} int j=0; int j=0; j 0 j<M j M j++ j++ j {
				if (i==A[j]){
					costB++;
				}
			} {
				if (i==A[j]){
					costB++;
				}
			} if (i==A[j]){
					costB++;
				} i==A[j] i A[j] A j {
					costB++;
				} costB++ costB System.out.println(Math.min(costA, costB)) System.out.println System.out System System.out Math.min(costA, costB) Math.min Math costA costB 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[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	}

} 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[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	}

} Main
import 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[] A = new int[M];
		for (int i=0; i<M; i++){
			A[i] = sc.nextInt();
		}
		int costA = 0;
		int costB = 0;
		for (int i=X; i<N; i++){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costA++;
				}
			}
		}
		for (int i=X; i>0; i--){
			for (int j=0; j<M; j++){
				if (i==A[j]){
					costB++;
				}
			}
		}
		System.out.println(Math.min(costA, costB));

	}

}