import java.util.Scanner;

public class Main {
	
	public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	}
	
} import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	}
	
} Main public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc m = sc.nextInt() m sc.nextInt() sc.nextInt sc x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			int a = sc.nextInt();
			if (a < x) cnt++;
		} {
			int a = sc.nextInt();
			if (a < x) cnt++;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a < x) cnt++; a < x a x cnt++ cnt System.out.println(Math.min(cnt, m - cnt)) System.out.println System.out System System.out Math.min(cnt, m - cnt) Math.min Math cnt m - cnt m cnt String... ac ac public class Main {
	
	public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	}
	
} public class Main {
	
	public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	}
	
} Main
import java.util.Scanner;

public class Main {
	
	public static void main(String... ac) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
		
		int cnt = 0;
		
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) cnt++;
		}
		
		System.out.println(Math.min(cnt, m - cnt));
		
	}
	
}