import java.util.Scanner;

/**
 *
 * @author must
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    }
    
} import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    }
    
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    } main {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    } 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 for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            A[i] = sc.nextInt();
        } {
            A[i] = sc.nextInt();
        } A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int cost0X = 0; cost0X 0 int costXN = 0; costXN 0 for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        } {
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        } if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            } A[i] < X A[i] A i X {
                cost0X++;
            } cost0X++ cost0X if(A[i] > X){
                costXN++;
            } A[i] > X A[i] A i X {
                costXN++;
            } costXN++ costXN int ans; ans if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        } cost0X > costXN cost0X costXN {
            ans = costXN;
        } ans = costXN ans costXN {
            ans = cost0X;
        } ans = cost0X ans cost0X System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    }
    
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    }
    
} Main
import java.util.Scanner;

/**
 *
 * @author must
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[M];
        
        for (int i=0;i<M;i++){
            A[i] = sc.nextInt();
        }
        
        //0 1 2 3 4 5 6
        
        int cost0X = 0;
        int costXN = 0;
        for(int i=0;i<M;i++){
            if(A[i] < X){
                cost0X++;
            }else if(A[i] > X){
                costXN++;
            }
        }
        int ans;
        if (cost0X > costXN){
            ans = costXN;
        }else{
            ans = cost0X;
        }
        System.out.println(ans);
        
    }
    
}
