import 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 x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
     	int n = scan.nextInt();
      	int m = scan.nextInt();
      	int x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
     	int n = scan.nextInt();
      	int m = scan.nextInt();
      	int x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    } main {
    	Scanner scan = new Scanner(System.in);
     	int n = scan.nextInt();
      	int m = scan.nextInt();
      	int x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    } 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 x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int[] A = new int[m]; A new int[m] m int smallcounter = 0; smallcounter 0 int bigcounter = 0; bigcounter 0 for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        } {
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        } A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            } A[i] < x A[i] A i x {
            	smallcounter++;
            } smallcounter++ smallcounter {
            	bigcounter++;
            } bigcounter++ bigcounter if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        } smallcounter < bigcounter smallcounter bigcounter {
        	System.out.print(smallcounter);
        } System.out.print(smallcounter) System.out.print System.out System System.out smallcounter {
        	System.out.print(bigcounter);
        } System.out.print(bigcounter) System.out.print System.out System System.out bigcounter 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 x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    }
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
     	int n = scan.nextInt();
      	int m = scan.nextInt();
      	int x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    }
} Main
import 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 x = scan.nextInt();
      	int[] A = new int[m];
      	int smallcounter = 0;//the number which smaller than x
      	int bigcounter = 0;//the number which larger than x
      	for(int i = 0; i < m; i++){
        	A[i] = scan.nextInt();
          	if(A[i] < x){
            	smallcounter++;
            }
          	else{
            	bigcounter++;
            }
        }
      	if(smallcounter < bigcounter){
        	System.out.print(smallcounter);
        }
      	else{
        	System.out.print(bigcounter);
        }
    }
}