import java.util.*;

public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    }

    static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    }


} import java.util.*; util.* java public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    }

    static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    }


} Main public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    } main {

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) Integer n = scan.nextInt(); n scan.nextInt() scan.nextInt scan Integer m = scan.nextInt(); m scan.nextInt() scan.nextInt scan Integer x = scan.nextInt(); x scan.nextInt() scan.nextInt scan ArrayList<Integer> a = new ArrayList<Integer>(); a new ArrayList<Integer>() for(int i=0;i<m;i++) a.add(scan.nextInt()); int i=0; int i=0; i 0 i<m i m i++ i++ i a.add(scan.nextInt()); a.add(scan.nextInt()) a.add a scan.nextInt() scan.nextInt scan Collections.sort(a) Collections.sort Collections a int cost1 = 0; cost1 0 int cost2 = 0; cost2 0 int p = 0; p 0 while(true){
            if(a.get(p) >= x) break;
            p++;
        } true {
            if(a.get(p) >= x) break;
            p++;
        } if(a.get(p) >= x) break; a.get(p) >= x a.get(p) a.get a p x break; p++ p cost1 = p cost1 p cost2 = a.size()-p cost2 a.size()-p a.size() a.size a p if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2); cost1 < cost2 cost1 cost2 System.out.println(cost1) System.out.println System.out System System.out cost1 System.out.println(cost2) System.out.println System.out System System.out cost2 String args[] args static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    } factorial {
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    } if(n == 0){
          return 1;
        } n == 0 n 0 {
          return 1;
        } return 1; 1 return n * factorial(n-1); n * factorial(n-1) n factorial(n-1) factorial n-1 n 1 int n n public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    }

    static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    }


} public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    }

    static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    }


} Main
import java.util.*;

public class Main{

    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        Integer n = scan.nextInt();
        Integer m = scan.nextInt();
        Integer x = scan.nextInt();
        ArrayList<Integer> a = new ArrayList<Integer>();

        for(int i=0;i<m;i++) a.add(scan.nextInt());

        Collections.sort(a);

        int cost1 = 0;
        int cost2 = 0;
        int p = 0;
        while(true){
            if(a.get(p) >= x) break;
            p++;
        }
        cost1 = p;
        cost2 = a.size()-p;
        if(cost1 < cost2)
            System.out.println(cost1);
        else
            System.out.println(cost2);
    }

    static int factorial(int n){
        if(n == 0){
          return 1;
        }
        return n * factorial(n-1);
    }


}