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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	}

} 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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	}

} 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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	} main {
		Scanner sc = new Scanner(System.in);

	int N= sc.nextInt();
	int M= sc.nextInt();
	int X= sc.nextInt();
	int a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	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 int M= sc.nextInt(); M sc.nextInt() sc.nextInt sc int X= sc.nextInt(); X sc.nextInt() sc.nextInt sc int a[]=new int[M]; a new int[M] M int cnt=0; cnt 0 for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	} int i=0; int i=0; i 0 i<M i M i++ i++ i {
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	} {
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	} a[i]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i]<X){
	            cnt=cnt+1;
	        } a[i]<X a[i] a i X {
	            cnt=cnt+1;
	        } cnt=cnt+1 cnt cnt+1 cnt 1 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[] 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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	}

} 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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	}

} 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 a[]=new int[M];
    int cnt=0;
	for(int i=0;i<M;i++){
		a[i]=sc.nextInt();
	        if(a[i]<X){
	            cnt=cnt+1;
	        }
	    
	}

    

	System.out.println(Math.min(cnt,M-cnt));


	}

}
