import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    } 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[N]; A new int[N] N 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 count = 0; count 0 for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            if(X > A[i]){
                count++;
            }
        } {
            if(X > A[i]){
                count++;
            }
        } if(X > A[i]){
                count++;
            } X > A[i] X A[i] A i {
                count++;
            } count++ count System.out.println(Math.min(count,M-count)) System.out.println System.out System System.out Math.min(count,M-count) Math.min Math count M-count M count String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        int[] A = new int[N];
        
        for(int i = 0; i < M; i++){
            A[i] = sc.nextInt();
        }
        
        int count = 0;
        for(int i = 0; i < M; i++){
            if(X > A[i]){
                count++;
            }
        }
        System.out.println(Math.min(count,M-count));
    }
}
