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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	}

} 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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	}

} 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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	} 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 array[] = new int[M]; array new int[M] M for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int x = 0; x 0 for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		} int j = 0; int j = 0; j 0 j < M j M j++ j++ j {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		} {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		} if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			} array[j] < X array[j] array j X {
				x += 1;
			} x += 1 x 1 {
				x += 0;
			} x += 0 x 0 System.out.println(Math.min(x, M-x)) System.out.println System.out System System.out Math.min(x, M-x) Math.min Math x M-x M x 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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	}

} 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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	}

} 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 array[] = new int[M];

		for(int i = 0; i < M; i++) {
			array[i] = sc.nextInt();
		}
		int x = 0;
		for(int j = 0; j < M; j++) {
			if(array[j] < X) {
				x += 1;
			}else {
				x += 0;
			}
		}

		System.out.println(Math.min(x, M-x));
	}

}
