import 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[m];
        int coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    }
} import java.util.*; util.* java 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[m];
        int coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    }
} 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 coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    } 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 coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    } 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 coutA = 0; coutA 0 int coutB = 0; coutB 0 for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        } {
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            } a[i] < x a[i] a i x {
                coutA++;
            } coutA++ coutA {
                coutB++;
            } coutB++ coutB System.out.println(Math.min(coutA, coutB)) System.out.println System.out System System.out Math.min(coutA, coutB) Math.min Math coutA coutB 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[m];
        int coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    }
} 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[m];
        int coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    }
} Main
import 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[m];
        int coutA = 0;
        int coutB = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x){
                coutA++;
            } else {
                coutB++;
            }
        }
        System.out.println(Math.min(coutA, coutB));
    }
}
