import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner int idx = 0; idx 0 for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		} int i=1; int i=1; i 1 i<=m i m i++ i++ i {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		} {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		} int num = scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner if (num<x) {
				idx = i;
			}else {
				break;
			} num<x num x {
				idx = i;
			} idx = i idx i {
				break;
			} break; if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		} idx<=m-idx idx m-idx m idx {
			System.out.println(idx);
		} System.out.println(idx) System.out.println System.out System System.out idx {
			System.out.println(m-idx);
		} System.out.println(m-idx) System.out.println System.out System System.out m-idx m idx String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int idx = 0;
		for (int i=1;i<=m; i++) {
			int num = scanner.nextInt();
			if (num<x) {
				idx = i;
			}else {
				break;
			}
		}
		if (idx<=m-idx) {
			System.out.println(idx);
		}else {
			System.out.println(m-idx);
		}

	}

}