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