import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    }

} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        } {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 leftCount = 0; leftCount 0 int rightCount = 0; rightCount 0 for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            } {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                } a < x a x {
                    leftCount++;
                } leftCount++ leftCount {
                    rightCount++;
                } rightCount++ rightCount int ans = Math.min(leftCount, rightCount); ans Math.min(leftCount, rightCount) Math.min Math leftCount rightCount System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    }

} public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int x = sc.nextInt();

            int leftCount = 0;
            int rightCount = 0;
            for (int i = 0; i < m; i++) {
                int a = sc.nextInt();
                if (a < x) {
                    leftCount++;
                } else {
                    rightCount++;
                }
            }

            int ans = Math.min(leftCount, rightCount);
            System.out.println(ans);
        }
    }

}
