import java.util.Arrays;
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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	}
} import java.util.Arrays; Arrays java.util 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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	}
} 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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	} 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[] A = new int[M]; A new int[M] M for(int i = 0;i < M;++i)
			A[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < M i M ++i ++i i A[i] = sc.nextInt(); A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc sc.close() sc.close sc int route0 = 0; route0 0 int routeN = 0; routeN 0 Arrays.sort(A) Arrays.sort Arrays A for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		} int i = 0; int i = 0; i 0 i < M i M ++i ++i i {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		} {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		} if(A[i] < X)
				route0++;
			else
				routeN++; A[i] < X A[i] A i X route0++ route0 routeN++ routeN if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0); route0 > routeN route0 routeN System.out.println(routeN) System.out.println System.out System System.out routeN System.out.println(route0) System.out.println System.out System System.out route0 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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	}
} 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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	}
} Main
import java.util.Arrays;
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[] A = new int[M];
		for(int i = 0;i < M;++i)
			A[i] = sc.nextInt();
		sc.close();
		
		int route0 = 0;
		int routeN = 0;
		Arrays.sort(A);
		for(int i = 0;i < M;++i) {
			if(A[i] < X)
				route0++;
			else
				routeN++;
		}
		if(route0 > routeN)
			System.out.println(routeN);
		else
			System.out.println(route0);
	}
}
