import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    }
} import java.io.IOException; IOException java.io import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    }
} Main public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    } 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[] = new int[m]; a new int[m] m for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        } int ct = 0; int ct = 0; ct 0 ct < a.length ct a.length a a.length ct++ ct++ ct {
            a[ct] = sc.nextInt();
        } {
            a[ct] = sc.nextInt();
        } a[ct] = sc.nextInt() a[ct] a ct sc.nextInt() sc.nextInt sc int lo = 0 lo 0 hi = 0; hi 0 for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        } int oki a {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        } {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        } if (oki < x) {
                lo++;
            } else {
                hi++;
            } oki < x oki x {
                lo++;
            } lo++ lo {
                hi++;
            } hi++ hi if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        } lo < hi lo hi {
            System.out.println(lo);
        } System.out.println(lo) System.out.println System.out System System.out lo {
            System.out.println(hi);
        } System.out.println(hi) System.out.println System.out System System.out hi String[] args args public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    }
} Main
import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a[] = new int[m];
        for (int ct = 0; ct < a.length; ct++) {
            a[ct] = sc.nextInt();
        }
        int lo = 0, hi = 0;
        for (int oki : a) {
            if (oki < x) {
                lo++;
            } else {
                hi++;
            }
        }
        if (lo < hi) {
            System.out.println(lo);
        } else {
            System.out.println(hi);
        }
    }
}
