import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        int x = stdIn.nextInt();
        int left = 0;
        int right = 0;

        for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        }
        
        if(right > left)
                System.out.println(left);
        else
            System.out.println(right);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        int x = stdIn.nextInt();
        int left = 0;
        int right = 0;

        for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        }
        
        if(right > left)
                System.out.println(left);
        else
            System.out.println(right);
    }
} Main public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        int x = stdIn.nextInt();
        int left = 0;
        int right = 0;

        for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        }
        
        if(right > left)
                System.out.println(left);
        else
            System.out.println(right);
    } main {
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        int x = stdIn.nextInt();
        int left = 0;
        int right = 0;

        for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        }
        
        if(right > left)
                System.out.println(left);
        else
            System.out.println(right);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int m = stdIn.nextInt(); m stdIn.nextInt() stdIn.nextInt stdIn int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn int left = 0; left 0 int right = 0; right 0 for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        } {
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        } int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn if(a < x)
                left++;
            else
                right++; a < x a x left++ left right++ right if(right > left)
                System.out.println(left);
        else
            System.out.println(right); right > left right left System.out.println(left) System.out.println System.out System System.out left System.out.println(right) System.out.println System.out System System.out right String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int m = stdIn.nextInt();
        int x = stdIn.nextInt();
        int left = 0;
        int right = 0;

        for(int i = 0; i < m; i++){
            int a = stdIn.nextInt();
            if(a < x)
                left++;
            else
                right++;
        }
        
        if(right > left)
                System.out.println(left);
        else
            System.out.println(right);
    }
}