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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    }
} 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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    }
} 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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    } 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 = 0; a 0 int b = 0; b 0 for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        } int i=0; int i=0; i 0 i<m i m i++ i++ i {
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        } {
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        } int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc if(s>x){
                a++;
            }else{
                b++;
            } s>x s x {
                a++;
            } a++ a {
                b++;
            } b++ b System.out.println(Math.min(a,b)) System.out.println System.out System System.out Math.min(a,b) Math.min Math a b 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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    }
} 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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    }
} 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 = 0;
        int b = 0;
        for(int i=0; i<m; i++){
            int s = sc.nextInt();
            if(s>x){
                a++;
            }else{
                b++;
            }
        }
        System.out.println(Math.min(a,b));
    }
}
