import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); }
		  } import java.util.Scanner; Scanner java.util public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); }
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); } main {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int M = scanner.nextInt(); M scanner.nextInt() scanner.nextInt scanner int X = scanner.nextInt(); X scanner.nextInt() scanner.nextInt scanner int[] station = new int[M]; station new int[M] M int costfor0 = 0; costfor0 0 int costforN = 0; costforN 0 for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    } {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    } station[i] = scanner.nextInt() station[i] station i scanner.nextInt() scanner.nextInt scanner if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	} station[i] < X station[i] station i X {
		    		costfor0++;
		    	} costfor0++ costfor0 {
		    		costforN++;
		    	} costforN++ costforN System.out.println( Math.min(costfor0, costforN) ) System.out.println System.out System System.out Math.min(costfor0, costforN) Math.min Math costfor0 costforN scanner.close() scanner.close scanner String args[] args public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); }
		  } public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); }
		  } Main
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int M = scanner.nextInt();
		    int X = scanner.nextInt();
		    int[] station = new int[M];
		    int costfor0 = 0;
		    int costforN = 0;
		    
		    for(int i = 0; i < M; i++) 
		    {
		    	station[i] = scanner.nextInt();
		    	if( station[i] < X ) 
		    	{
		    		costfor0++;
		    	}
		    	else 
		    	{
		    		costforN++;
		    	}
		    }
		    System.out.println( Math.min(costfor0, costforN) );
		    scanner.close(); }
		  }