import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    } main {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int mathNum = Integer.parseInt(sc.next()); mathNum Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int priceMathNum = Integer.parseInt(sc.next()); priceMathNum Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int start = Integer.parseInt(sc.next()); start Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        } int x=1; int x=1; x 1 x<=priceMathNum x priceMathNum x++ x++ x {
            list.add(Integer.parseInt(sc.next()));
        } {
            list.add(Integer.parseInt(sc.next()));
        } list.add(Integer.parseInt(sc.next())) list.add list Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x = 0; x 0 int y = 0; y 0 for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        } int z list {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        } {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        } if (start > z) {
                x++;
            } else {
                y++;
            } start > z start z {
                x++;
            } x++ x {
                y++;
            } y++ y System.out.println(x>y?y:x) System.out.println System.out System System.out x>y?y:x x>y x y y x String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int mathNum = Integer.parseInt(sc.next());
        int priceMathNum = Integer.parseInt(sc.next());
        int start = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x=1; x<=priceMathNum; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int x = 0;
        int y = 0;
        for (int z:list) {
            if (start > z) {
                x++;
            } else {
                y++;
            }
        }
        
        System.out.println(x>y?y:x);
    }
}