
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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	}

} 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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	}

} 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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	} 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 start = 0; start 0 int end = 0; end 0 for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		} {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc if(tmp < x) {
				start++;
			} else {
				end++;
			} tmp < x tmp x {
				start++;
			} start++ start {
				end++;
			} end++ end System.out.println(Math.min(start, end)) System.out.println System.out System System.out Math.min(start, end) Math.min Math start end 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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	}

} 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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	}

} 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 start = 0;
		int end = 0;
		for(int i = 0; i < m; i++) {
			int tmp = sc.nextInt();
			if(tmp < x) {
				start++;
			} else {
				end++;
			}
		}
		System.out.println(Math.min(start, end));
	}

}
