
import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	}
} import java.sql.Array; Array java.sql import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int start = scan.nextInt(); start scan.nextInt() scan.nextInt scan int[] cost = new int[m]; cost new int[m] m for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < cost.length i cost.length cost cost.length i++ i++ i {
			cost[i] = scan.nextInt();
		} {
			cost[i] = scan.nextInt();
		} cost[i] = scan.nextInt() cost[i] cost i scan.nextInt() scan.nextInt scan int countA = 0; countA 0 int countB = 0; countB 0 for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		} int i = 0; int i = 0; i 0 i < cost.length i cost.length cost cost.length i++ i++ i {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		} {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		} if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			} cost[i] < start cost[i] cost i start {
				countA++;
			} countA++ countA {
				countB++;
			} countB++ countB System.out.println(Math.min(countA, countB)) System.out.println System.out System System.out Math.min(countA, countB) Math.min Math countA countB String[] args args public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	}
} public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	}
} Main

import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int start = scan.nextInt();
		
		int[] cost = new int[m];
		for (int i = 0; i < cost.length; i++) {
			cost[i] = scan.nextInt();
		}
		
		int countA = 0;
		int countB = 0;
		
		for (int i = 0; i < cost.length; i++) {
			if (cost[i] < start) {
				countA++;
			} else {
				countB++;
			}
		}
		
		System.out.println(Math.min(countA, countB));
	}
}