import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	} main {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int M = scan.nextInt(); M scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int []A = new int[M]; A new int[M] M for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i< M i M i++ i++ i {
			A[i] = scan.nextInt();
		} {
			A[i] = scan.nextInt();
		} A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan scan.close() scan.close scan int index1 = X; index1 X int cost1 = 0; cost1 0 int cost2 = 0; cost2 0 for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		} int i = 0; int i = 0; i 0 i < X - 1 i X - 1 X 1 i++ i++ i {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		} {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		} index1 -- index1 for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
				if(index1 == A[j]) {
					cost1 ++;
				}
			} {
				if(index1 == A[j]) {
					cost1 ++;
				}
			} if(index1 == A[j]) {
					cost1 ++;
				} index1 == A[j] index1 A[j] A j {
					cost1 ++;
				} cost1 ++ cost1 cost2 = A.length - cost1 cost2 A.length - cost1 A.length A A.length cost1 if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		} cost2 > cost1 cost2 cost1 {
			System.out.println(cost1);
		} System.out.println(cost1) System.out.println System.out System System.out cost1 {
			System.out.println(cost2);
		} System.out.println(cost2) System.out.println System.out System System.out cost2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		int X = scan.nextInt();
		int []A = new int[M];
		for(int i = 0; i< M; i++) {
			A[i] = scan.nextInt();
		}
		scan.close();
		int index1 = X;
		int cost1 = 0;
		int cost2 = 0;
		for(int i = 0; i < X - 1; i++) {
			index1 --;
			for(int j = 0; j < M; j++) {
				if(index1 == A[j]) {
					cost1 ++;
				}
			}
		}
		cost2 = A.length - cost1;
		if(cost2 > cost1) {
			System.out.println(cost1);
		}else {
			System.out.println(cost2);
		}

	}
}