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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    } 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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    } 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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int []a = new int[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      } 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[N]; a new int[N] N int migi = 0; migi 0 int hidari = 0; hidari 0 for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        } {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 } a[i]<X a[i] a i X {
        	 		hidari++;
        	 	} hidari++ hidari {
        	 		migi++;
         	 } migi++ migi System.out.println(Math.min(migi,hidari)) System.out.println System.out System System.out Math.min(migi,hidari) Math.min Math migi hidari 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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    } 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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    } 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[N];
        
        int migi = 0;
        int hidari = 0;
        for(int i=0; i<M; i++) {
        	 a[i] = sc.nextInt();
        	 	if(a[i]<X) {
        	 		hidari++;
        	 	}else {
        	 		migi++;
         	 }
        }
      System.out.println(Math.min(migi,hidari));
      }
    }