import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    } 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 left = 0; left 0 int right = 0; right 0 for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        } {
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        } int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc if(tmp < x){
                left++;
            }else{
                right++;
            } tmp < x tmp x {
                left++;
            } left++ left {
                right++;
            } right++ right System.out.println(Math.min(left,right)) System.out.println System.out System System.out Math.min(left,right) Math.min Math left right String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int left = 0;
        int right = 0;
        for(int i = 0; i < m; i++){
            int tmp = sc.nextInt();
            if(tmp < x){
                left++;
            }else{
                right++;
            }
        }
        System.out.println(Math.min(left,right));
    }
}
