import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int[] array = new int[m]; array new int[m] m int left = 0; left 0 int right = 0; right 0 for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		} {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		} array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan if(array[i] < x) {
				left++;
			} else {
				right++;
			} array[i] < x array[i] array i x {
				left++;
			} left++ left {
				right++;
			} right++ right System.out.println(Math.min(left, right)) System.out.println System.out System System.out Math.min(left, right) Math.min Math left right String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] array = new int[m];

		int left = 0;
		int right = 0;
		for (int i = 0; i < m; i++) {
			array[i] = scan.nextInt();
			if(array[i] < x) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(Math.min(left, right));
	}
}