import java.util.Scanner;

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

        int a[] = new int[m];
        int totalL = 0;
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        }
        System.out.println(Math.min(totalL, m - totalL));
    } 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 int totalL = 0; totalL 0 for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        } {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if (a[i] < x) totalL++; a[i] < x a[i] a i x totalL++ totalL System.out.println(Math.min(totalL, m - totalL)) System.out.println System.out System System.out Math.min(totalL, m - totalL) Math.min Math totalL m - totalL m totalL 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[] = new int[m];
        int totalL = 0;
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        }
        System.out.println(Math.min(totalL, m - totalL));
    }
} 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[] = new int[m];
        int totalL = 0;
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        }
        System.out.println(Math.min(totalL, m - totalL));
    }
} Main
import java.util.Scanner;

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[] = new int[m];
        int totalL = 0;
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            if (a[i] < x) totalL++;
        }
        System.out.println(Math.min(totalL, m - totalL));
    }
}
