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