import java.util.*;

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 cost_0_X = 0;
		int cost_X_N = 0;
		
		int[] A = new int[ M ];
		for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		}
		System.out.println(Math.min(cost_0_X , cost_X_N ));

	}
} import java.util.*; util.* java 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 cost_0_X = 0;
		int cost_X_N = 0;
		
		int[] A = new int[ M ];
		for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		}
		System.out.println(Math.min(cost_0_X , cost_X_N ));

	}
} 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 cost_0_X = 0;
		int cost_X_N = 0;
		
		int[] A = new int[ M ];
		for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		}
		System.out.println(Math.min(cost_0_X , cost_X_N ));

	} main {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		
		int cost_0_X = 0;
		int cost_X_N = 0;
		
		int[] A = new int[ M ];
		for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		}
		System.out.println(Math.min(cost_0_X , cost_X_N ));

	} 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 cost_0_X = 0; cost_0_X 0 int cost_X_N = 0; cost_X_N 0 int[] A = new int[ M ]; A new int[ M ] M for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		} int i = 0; int i = 0; i 0 i < M i M i ++ i ++ i {
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		} {
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		} A[ i ] = sc.nextInt() A[ i ] A i sc.nextInt() sc.nextInt sc if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			} A[ i ] <= X A[ i ] A i X {
				cost_0_X ++ ;
			} cost_0_X ++ cost_0_X {
				cost_X_N ++;
			} cost_X_N ++ cost_X_N System.out.println(Math.min(cost_0_X , cost_X_N )) System.out.println System.out System System.out Math.min(cost_0_X , cost_X_N ) Math.min Math cost_0_X cost_X_N String[] args args
import java.util.*;

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 cost_0_X = 0;
		int cost_X_N = 0;
		
		int[] A = new int[ M ];
		for(int i = 0; i < M ; i ++){
			A[ i ] = sc.nextInt();
			if(A[ i ] <= X ){
				cost_0_X ++ ;
			} else{
				cost_X_N ++;
			}
		}
		System.out.println(Math.min(cost_0_X , cost_X_N ));

	}
}
