import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	}
} 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(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt() n sc.nextInt() sc.nextInt sc m=sc.nextInt() m sc.nextInt() sc.nextInt sc 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]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int cost1=0 cost1 0 cost2=0; cost2 0 for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		} Integer i a {
			if(i > x) cost1++;
			else cost2++;
		} {
			if(i > x) cost1++;
			else cost2++;
		} if(i > x) cost1++;
			else cost2++; i > x i x cost1++ cost1 cost2++ cost2 System.out.println(cost1 < cost2 ? cost1:cost2) System.out.println System.out System System.out cost1 < cost2 ? cost1:cost2 cost1 < cost2 cost1 cost2 cost1 cost2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt(),x=sc.nextInt();
		int[] a = new int[m];
		for(int i=0; i<m; i++) {
			a[i]=sc.nextInt();
		}
		int cost1=0,cost2=0;
		for (Integer i : a) {
			if(i > x) cost1++;
			else cost2++;
		}
		System.out.println(cost1 < cost2 ? cost1:cost2);
	}
}
