import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int M = Integer.parseInt(sc.next()); M Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int X = Integer.parseInt(sc.next()); X Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc ArrayList<Integer> cost = new ArrayList<>(); cost new ArrayList<>() int left = 0; left 0 int right = 0; right 0 for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		} {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		} cost.add(Integer.parseInt(sc.next())) cost.add cost Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			} cost.get(i) < X cost.get(i) cost.get cost i X {
				left++;
			} left++ left {
				right++;
			} right++ right sc.close() sc.close sc 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 sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		ArrayList<Integer> cost = new ArrayList<>();
		int left = 0;
		int right = 0;
		for(int i = 0; i < M; i++) {
			cost.add(Integer.parseInt(sc.next()));
			if(cost.get(i) < X) {
				left++;
			}else {
				right++;
			}
		}
		sc.close();

		System.out.println(Math.min(left, right));

	}

}
