import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    }

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

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    } @SuppressWarnings("resource")
        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[n]; a new int[n] n 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 int l = 0; l 0 int r = 0; r 0 for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        } int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        } {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        } if (a[i] < x) {
                l++;
            } else {
                r++;
            } a[i] < x a[i] a i x {
                l++;
            } l++ l {
                r++;
            } r++ r System.out.println(Math.min(l, r)) System.out.println System.out System System.out Math.min(l, r) Math.min Math l r String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x  = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0 ; i < m ; i++) {
            a[i] = sc.nextInt();
        }
        int l = 0;
        int r = 0;
        for (int i = 0 ; i < m ; i++) {
            if (a[i] < x) {
                l++;
            } else {
                r++;
            }
        }
        System.out.println(Math.min(l, r));
    }

}