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];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	}
} 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];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	}
} 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];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int A[] = new int[M];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	} 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 int h=0; h 0 int l=0; l 0 for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		} int i =0; int i =0; i 0 i<=M-1 i M-1 M 1 i++ i++ i {
			A[i] = sc.nextInt();
		} {
			A[i] = sc.nextInt();
		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		} int i =0; int i =0; i 0 i<=M-1 i M-1 M 1 i++ i++ i {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		} {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		} if(A[i]<X) {
				l++;
			}else {
				h++;
			} A[i]<X A[i] A i X {
				l++;
			} l++ l {
				h++;
			} h++ h if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		} l>h l h {
			System.out.println(h);
		} System.out.println(h) System.out.println System.out System System.out h if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		} l < h l h {
			System.out.println(l);
		} System.out.println(l) System.out.println System.out System System.out l {
			System.out.println(l);
		} System.out.println(l) System.out.println System.out System System.out l 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];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	}
} 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];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	}
} 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 A[] = new int[M];
		int h=0;
		int l=0;
		for(int i =0; i<=M-1; i++) {
			A[i] = sc.nextInt();
		}
		for(int i =0; i<=M-1; i++) {
			if(A[i]<X) {
				l++;
			}else {
				h++;
			}
		}
		if(l>h) {
			System.out.println(h);
		}
		else if(l < h) {
			System.out.println(l);
		}else {
			System.out.println(l);
		}
	}
}