import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x = Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int less = 0; less 0 for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		} {
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		} int s = Integer.parseInt(sc.next()); s Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (s < x){
				less += 1;
			}else{
				break;
			} s < x s x {
				less += 1;
			} less += 1 less 1 {
				break;
			} break; System.out.println(Math.min(less, m-less)) System.out.println System.out System System.out Math.min(less, m-less) Math.min Math less m-less m less String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int less = 0;

		for(int i=0; i<m; i++){
			int s = Integer.parseInt(sc.next());
			if (s < x){
				less += 1;
			}else{
				break;
			}
		}
		System.out.println(Math.min(less, m-less));
	}
}