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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	}
} 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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	}
} 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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();

		int l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	} 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 l = 0; l 0 int r = 0; r 0 for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		} {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a < x) {
				l++;
			} else {
				r++;
			} a < x a x {
				l++;
			} l++ l {
				r++;
			} r++ r System.out.println(Math.min(l, r)) System.out.println System.out System System.out Math.min(l, r) Math.min Math l r sc.close() sc.close sc 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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	}
} 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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	}
} 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 l = 0;
		int r = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				l++;
			} else {
				r++;
			}
		}

		System.out.println(Math.min(l, r));

		sc.close();
	}
}
