import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    Main() {
        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++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        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 static void main(String[] args) {
        new Main();
    }
} import java.math.BigInteger; BigInteger java.math import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Map.Entry; Entry java.util.Map import java.util.PriorityQueue; PriorityQueue java.util import java.util.Scanner; Scanner java.util class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    Main() {
        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++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        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 static void main(String[] args) {
        new Main();
    }
} Main static final int MOD = 1000000007; MOD 1000000007 static final int INF = 1 << 30; INF 1 << 30 1 30 Main() {
        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++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        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 {
        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++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        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));
    } 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++) {
            int num = sc.nextInt();
            a[i] = num;
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            int num = sc.nextInt();
            a[i] = num;
        } {
            int num = sc.nextInt();
            a[i] = num;
        } int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc a[i] = num a[i] a i num 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 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 public static void main(String[] args) {
        new Main();
    } main {
        new Main();
    } new Main() String[] args args
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;

    Main() {
        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++) {
            int num = sc.nextInt();
            a[i] = num;
        }
        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 static void main(String[] args) {
        new Main();
    }
}
