import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),x=scan.nextInt(),a,l=0,r=0,i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		}
		scan.close();
		System.out.print(r>l?l:r);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),x=scan.nextInt(),a,l=0,r=0,i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		}
		scan.close();
		System.out.print(r>l?l:r);
	}
} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),x=scan.nextInt(),a,l=0,r=0,i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		}
		scan.close();
		System.out.print(r>l?l:r);
	} main {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),x=scan.nextInt(),a,l=0,r=0,i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		}
		scan.close();
		System.out.print(r>l?l:r);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt() n scan.nextInt() scan.nextInt scan m=scan.nextInt() m scan.nextInt() scan.nextInt scan x=scan.nextInt() x scan.nextInt() scan.nextInt scan a a l=0 l 0 r=0 r 0 i; i for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		} i=0; i=0 i 0 i<m i m i++ i++ i {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		} {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		} a=scan.nextInt() a scan.nextInt() scan.nextInt scan if(a>x) r++;
			else l++; a>x a x r++ r l++ l scan.close() scan.close scan System.out.print(r>l?l:r) System.out.print System.out System System.out r>l?l:r r>l r l l r String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt(),m=scan.nextInt(),x=scan.nextInt(),a,l=0,r=0,i;
		for(i=0;i<m;i++) {
			a=scan.nextInt();
			if(a>x) r++;
			else l++;
		}
		scan.close();
		System.out.print(r>l?l:r);
	}
}