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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	}
} 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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	}
} 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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	} 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 row = 0; row 0 int high = 0; high 0 for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		} {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		} if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			} X > sc.nextInt() X sc.nextInt() sc.nextInt sc {
				row++;
			} row++ row {
				high++;
			} high++ high System.out.println(Math.min(row, high)) System.out.println System.out System System.out Math.min(row, high) Math.min Math row high 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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	}
} 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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	}
} 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 row = 0;
		int high = 0;
		for(int i = 0; i < M; i++) {
			if(X > sc.nextInt()) {
				row++;
			}else {
				high++;
			}
		}
		System.out.println(Math.min(row, high));
	}
}
