import java.util.*;

import static java.lang.Integer.min;

public class Main {

    public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    }

} import java.util.*; util.* java import static java.lang.Integer.min; import static java.lang.Integer.min; import static java.lang.Integer.min; public class Main {

    public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    }

} Main public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    } main {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    } int right = 0 right 0 left = 0 left 0 n n m m x; x Scanner s = new Scanner(System.in); s new Scanner(System.in) n = s.nextInt() n s.nextInt() s.nextInt s m = s.nextInt() m s.nextInt() s.nextInt s x = s.nextInt() x s.nextInt() s.nextInt s for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        } {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        } int tmp = s.nextInt(); tmp s.nextInt() s.nextInt s if (tmp < x) left++;
            else right++; tmp < x tmp x left++ left right++ right System.out.println(min(right, left)) System.out.println System.out System System.out min(right, left) min right left String[] args args public class Main {

    public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    }

} public class Main {

    public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    }

} Main
import java.util.*;

import static java.lang.Integer.min;

public class Main {

    public static void main(String[] args) {
        int right = 0, left = 0, n, m, x;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        x = s.nextInt();
        for (int i = 0; i < m; i++) {
            int tmp = s.nextInt();
            if (tmp < x) left++;
            else right++;
        }
        System.out.println(min(right, left));
    }

}
