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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    }
} 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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    }
} 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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int a = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    } 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 = 0; a 0 int cntL = 0; cntL 0 int cntR = 0; cntR 0 for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        } {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        } a = sc.nextInt() a sc.nextInt() sc.nextInt sc if (a < x)
                cntL++;
            else if (a < n)
                cntR++; a < x a x cntL++ cntL if (a < n)
                cntR++; a < n a n cntR++ cntR System.out.print(Math.min(cntL, cntR)) System.out.print System.out System System.out Math.min(cntL, cntR) Math.min Math cntL cntR 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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    }
} 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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    }
} 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 = 0;

        int cntL = 0;
        int cntR = 0;

        for (int i = 0; i < m; i++) {
            a = sc.nextInt();
            if (a < x)
                cntL++;
            else if (a < n)
                cntR++;
        }

        System.out.print(Math.min(cntL, cntR));
    }
}
