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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	}

	static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	}
} 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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	}

	static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	}
} 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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	} main {
		// 入力
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	} 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[] aArray = new int[m]; aArray new int[m] m int check = 0; check 0 for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		} {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		} aArray[i] = scanner.nextInt() aArray[i] aArray i scanner.nextInt() scanner.nextInt scanner if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			} check(aArray[i], n-1) && check < aArray[i] check(aArray[i], n-1) check aArray[i] aArray i n-1 n 1 check < aArray[i] check aArray[i] aArray i {
				check = aArray[i];
			} check = aArray[i] check aArray[i] aArray i {
				
			} if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		} check(n, 100) && check(m, 100) && check(x, n-1) check(n, 100) && check(m, 100) && check(x, n-1) check(n, 100) check n 100 check(m, 100) check m 100 check(x, n-1) check x n-1 n 1 {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} int point = 0; point 0 for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			} int i = 0; int i = 0; i 0 i < aArray.length i aArray.length aArray aArray.length i++ i++ i {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			} {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			} if(x < aArray[i]) {
					point = i;
					break;
				} x < aArray[i] x aArray[i] aArray i {
					point = i;
					break;
				} point = i point i break; System.out.println(Math.min(point, m-point)) System.out.println System.out System System.out Math.min(point, m-point) Math.min Math point m-point m point {
		} String[] args args static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	} check {
		return (1 <= input && input <=  max);
	} return (1 <= input && input <=  max); (1 <= input && input <=  max) 1 <= input 1 input input <=  max input max int input input int max max 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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	}

	static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	}
} 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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	}

	static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	}
} 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[] aArray = new int[m];

		int check = 0;
		for (int i = 0; i < m; i++) {
			aArray[i] = scanner.nextInt();
			if(check(aArray[i], n-1) && check < aArray[i]) {
				check = aArray[i];
			} else {
				
			}
		}


		if(check(n, 100) && check(m, 100) && check(x, n-1)) {
			int point = 0;
			for (int i = 0; i < aArray.length; i++) {
				if(x < aArray[i]) {
					point = i;
					break;
				}
			}
			System.out.println(Math.min(point, m-point));
		} else {
		}



	}

	static boolean check(int input, int max) {
		return (1 <= input && input <=  max);
	}
}