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 ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		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 ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		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 ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		sc.close();
	} main {
		Scanner sc = new Scanner((System.in));
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

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

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		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 ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		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 ans = 0, l = 0, r = 0;

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

		if (r < l) {
			ans = r;
		} else {
			ans = l;
		}

		System.out.println(ans);

		sc.close();
	}
}
