import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	} 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[] input = new int[M]; input new int[M] M int left = 0; left 0 int right = 0; right 0 for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		} int i = 0; int i = 0; i 0 i < input.length i input.length input input.length i++ i++ i {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		} {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc input[i] = tmp input[i] input i tmp if (X < tmp) {
				right++;
			} else {
				left++;
			} X < tmp X tmp {
				right++;
			} right++ right {
				left++;
			} left++ left 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) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int[] input = new int[M];
		int left = 0;
		int right = 0;
		for (int i = 0; i < input.length; i++) {
			int tmp = sc.nextInt();
			input[i] = tmp;
			if (X < tmp) {
				right++;
			} else {
				left++;
			}
		}
		System.out.println(Math.min(left, right));

	}
}
