import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
}
//鶏になれ import java.util.*; util.* java public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
} Main public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        } main {
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc 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 sc.close() sc.close sc int yono = 0; yono 0 int pct = 0; pct 0 for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                } int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                } {
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                } if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        } a[i] < x a[i] a i x {
                                yono++;
                        } yono++ yono {
                                pct++;
                        } pct++ pct System.out.println(Math.min(yono , pct)) System.out.println System.out System System.out Math.min(yono , pct) Math.min Math yono pct String[] args args public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
} public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
} Main
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
}
//鶏になれ
