import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 sc.nextLine() sc.nextLine sc String[] a = sc.nextLine().split(" "); a sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int leftCost = 0; leftCost 0 for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		} String s a {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		} {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		} if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			} Integer.parseInt(s) < x Integer.parseInt(s) Integer.parseInt Integer s x {
				leftCost++;
			} leftCost++ leftCost {
				break;
			} break; System.out.println(Math.min(leftCost, m - leftCost)) System.out.println System.out System System.out Math.min(leftCost, m - leftCost) Math.min Math leftCost m - leftCost m leftCost sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.nextInt();// Nは読み捨て
		int m = sc.nextInt();
		int x = sc.nextInt();
		sc.nextLine();// 改行読み捨て
		String[] a = sc.nextLine().split(" ");
		int leftCost = 0;
		for (String s : a) {
			if (Integer.parseInt(s) < x) {
				leftCost++;
			} else {
				break;
			}
		}

		System.out.println(Math.min(leftCost, m - leftCost));

		sc.close();
	}
}