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