import java.util.Scanner;
 
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 count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	}
} import java.util.Scanner; Scanner java.util 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 count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	}
} 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 count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	} 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 count = 0; count 0 for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		} {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a < x) {
				count++;
			} a < x a x {
				count++;
			} count++ count System.out.println(Math.min(count, m - count)) System.out.println System.out System System.out Math.min(count, m - count) Math.min Math count m - count m count String[] args args
import java.util.Scanner;
 
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 count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	}
}