import java.util.Scanner;

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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    }
} import java.util.Scanner; Scanner 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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    }
} 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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    } 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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    } 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 count = 0; count 0 int count2 = 0; count2 0 for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        } int i = 0; int i = 0; i 0 i<M i M i++ i++ i {
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        } {
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            } A[i]<X A[i] A i X {
                count += 1;
            } count += 1 count 1 if(A[i]>X){
                count2 += 1;
            } A[i]>X A[i] A i X {
                count2 += 1;
            } count2 += 1 count2 1 System.out.println(Math.min(count,count2)) System.out.println System.out System System.out Math.min(count,count2) Math.min Math count count2 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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    }
} 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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    }
} Main
import java.util.Scanner;

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 count = 0;
        int count2 = 0;
        for(int i = 0;i<M;i++){
            A[i] = sc.nextInt();
            if(A[i]<X){
                count += 1;
            }
            else if(A[i]>X){
                count2 += 1;
            }
        }
        System.out.println(Math.min(count,count2));
    }
}