import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int[] a = new int[m]; a new int[m] m int g1 = 0; g1 0 int g2 = 0; g2 0 for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        } {
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        } a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan if(a[i] < x) g1++;
            else g2++; a[i] < x a[i] a i x g1++ g1 g2++ g2 System.out.println((int)(Math.min(g1, g2))) System.out.println System.out System System.out (int)(Math.min(g1, g2)) Math.min Math g1 g2 scan.close() scan.close scan String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int x = scan.nextInt();
        int[] a = new int[m];
        int g1 = 0;
        int g2 = 0;
        for(int i = 0; i < m; i++){
            a[i] = scan.nextInt();
            if(a[i] < x) g1++;
            else g2++;
        }
        System.out.println((int)(Math.min(g1, g2)));
        scan.close();
    }
}