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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	}

} 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	}

} 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	} 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	} 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] A i sc.nextInt() sc.nextInt sc int cur=0; cur 0 while (cur<M && A[cur]<X)
			cur++; cur<M && A[cur]<X cur<M cur M A[cur]<X A[cur] A cur X cur++ cur System.out.println(Math.min(cur, M-cur)) System.out.println System.out System System.out Math.min(cur, M-cur) Math.min Math cur M-cur M cur 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	}

} 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	}

} 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();
		
		int cur=0;
		while (cur<M && A[cur]<X)
			cur++;
		
		//System.out.println(cur);
		System.out.println(Math.min(cur, M-cur));
		
		
	}

}
