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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	}

} 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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	}

} 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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

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

		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	} 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 costL = 0; costL 0 int costR = 0; costR 0 for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		} {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc if(tmp < X) {
				costL++;
			} else {
				costR++;
			} tmp < X tmp X {
				costL++;
			} costL++ costL {
				costR++;
			} costR++ costR System.out.println(Math.min(costL,costR)) System.out.println System.out System System.out Math.min(costL,costR) Math.min Math costL costR 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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	}

} 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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	}

} 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 costL = 0;
		int costR = 0;

		for(int i = 0; i < M; i++) {
			int tmp = sc.nextInt();
			if(tmp < X) {
				costL++;
			} else {
				costR++;
			}
		}

		System.out.println(Math.min(costL,costR));

	}

}
