import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() 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 cnt = 0; cnt 0 for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		} {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if (a[i] < x) {
				cnt++;
			} a[i] < x a[i] a i x {
				cnt++;
			} cnt++ cnt System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt) System.out.println System.out System System.out (cnt < a.length - cnt) ? cnt : a.length - cnt (cnt < a.length - cnt) cnt a.length - cnt a.length a a.length cnt cnt a.length - cnt a.length a a.length cnt String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] a = new int[m];
		int cnt = 0;
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			if (a[i] < x) {
				cnt++;
			}
		}

		System.out.println((cnt < a.length - cnt) ? cnt : a.length - cnt);

	}
}
