import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	}

} 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();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int 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 for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		} int i = 0; int i = 0; i 0 i < M - 1 i M - 1 M 1 i++ i++ i {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		} {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		} if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			} X < A[0] || X > A[M - 1] X < A[0] X A[0] A 0 X > A[M - 1] X A[M - 1] A M - 1 M 1 {
				System.out.println(0);
				break;
			} System.out.println(0) System.out.println System.out System System.out 0 break; if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			} X > A[i] && X < A[i+1] X > A[i] X A[i] A i X < A[i+1] X A[i+1] A i+1 i 1 {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			} if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				} i < (M / 2) i (M / 2) M 2 {
					System.out.println(i + 1);
					break;
				} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 break; if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				} i == (M / 2) i (M / 2) M 2 {
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				} System.out.println(Math.min(i + 1, M - (i + 1))) System.out.println System.out System System.out Math.min(i + 1, M - (i + 1)) Math.min Math i + 1 i 1 M - (i + 1) M (i + 1) i 1 break; {
					System.out.println(M - (i + 1));
					break;
				} System.out.println(M - (i + 1)) System.out.println System.out System System.out M - (i + 1) M (i + 1) i 1 break; sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0; i < M; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M - 1; i++) {
			if(X < A[0] || X > A[M - 1]) {
				System.out.println(0);
				break;
			}
			if(X > A[i] && X < A[i+1]) {
				if(i < (M / 2)) {
					System.out.println(i + 1);
					break;
				}else if(i == (M / 2)){
					System.out.println(Math.min(i + 1, M - (i + 1)));
					break;
				}else{
					System.out.println(M - (i + 1));
					break;
				}
			}
		}
		sc.close();
	}

}
