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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	}
} 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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	}
} 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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	} 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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	} 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] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int countmin=0; countmin 0 int countmax=0; countmax 0 for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		} {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		} if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			} A[i]<X A[i] A i X {
				countmin++;
			} countmin++ countmin {
				countmax++;
			} countmax++ countmax if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		} countmin<countmax countmin countmax {
			System.out.println(countmin);
		} System.out.println(countmin) System.out.println System.out System System.out countmin {
			System.out.println(countmax);
		} System.out.println(countmax) System.out.println System.out System System.out countmax 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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	}
} 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();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	}
} 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];
		for (int i=0;i<M;i++) {
			A[i] = sc.nextInt();
		}
		int countmin=0;
		int countmax=0;
		for (int i=0;i<M;i++) {
			if (A[i]<X) {
				countmin++;
			} else {
				countmax++;
			}
		}
		if (countmin<countmax) {
			System.out.println(countmin);
		} else {
			System.out.println(countmax);
		}
	}
}