import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
        int[] a = new int[m];
        int cntl = 0, cntr = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        }
        System.out.println(Math.min(cntl, cntr));
    }
} import java.util.*; util.* java class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
        int[] a = new int[m];
        int cntl = 0, cntr = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        }
        System.out.println(Math.min(cntl, cntr));
    }
} Main public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
        int[] a = new int[m];
        int cntl = 0, cntr = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        }
        System.out.println(Math.min(cntl, cntr));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
        int[] a = new int[m];
        int cntl = 0, cntr = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        }
        System.out.println(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 m = sc.nextInt() m sc.nextInt() sc.nextInt sc x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int[] a = new int[m]; a new int[m] m int cntl = 0 cntl 0 cntr = 0; cntr 0 for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        } {
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i] < x) cntl++;
            else cntr++; a[i] < x a[i] a i x cntl++ cntl cntr++ cntr System.out.println(Math.min(cntl, cntr)) System.out.println System.out System System.out Math.min(cntl, cntr) Math.min Math cntl cntr String[] args args
import java.util.*;
class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), x = sc.nextInt();
        int[] a = new int[m];
        int cntl = 0, cntr = 0;
        for(int i = 0; i < m; i++){
            a[i] = sc.nextInt();
            if(a[i] < x) cntl++;
            else cntr++;
        }
        System.out.println(Math.min(cntl, cntr));
    }
}