import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    List<Integer> ls = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    }
    sc.close();
    List<Integer> prev = new ArrayList<>();
    List<Integer> next = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    }
    if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    }
  }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    List<Integer> ls = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    }
    sc.close();
    List<Integer> prev = new ArrayList<>();
    List<Integer> next = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    }
    if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    List<Integer> ls = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    }
    sc.close();
    List<Integer> prev = new ArrayList<>();
    List<Integer> next = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    }
    if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    }
  } main {
    Scanner sc = new Scanner(System.in);
    sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    List<Integer> ls = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    }
    sc.close();
    List<Integer> prev = new ArrayList<>();
    List<Integer> next = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    }
    if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 List<Integer> ls = new ArrayList<>(); ls new ArrayList<>() for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      ls.add(sc.nextInt());
    } {
      ls.add(sc.nextInt());
    } ls.add(sc.nextInt()) ls.add ls sc.nextInt() sc.nextInt sc sc.close() sc.close sc List<Integer> prev = new ArrayList<>(); prev new ArrayList<>() List<Integer> next = new ArrayList<>(); next new ArrayList<>() for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    } {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    } if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      } ls.get(i) > x ls.get(i) ls.get ls i x {
        next.add(ls.get(i));
      } next.add(ls.get(i)) next.add next ls.get(i) ls.get ls i {
        prev.add(ls.get(i));
      } prev.add(ls.get(i)) prev.add prev ls.get(i) ls.get ls i if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    } next.size() >= prev.size() next.size() next.size next prev.size() prev.size prev {
      System.out.println(prev.size());
    } System.out.println(prev.size()) System.out.println System.out System System.out prev.size() prev.size prev {
      System.out.println(next.size());
    } System.out.println(next.size()) System.out.println System.out System System.out next.size() next.size next String[] args args
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    List<Integer> ls = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      ls.add(sc.nextInt());
    }
    sc.close();
    List<Integer> prev = new ArrayList<>();
    List<Integer> next = new ArrayList<>();
    for (int i = 0; i < m; i++) {
      if (ls.get(i) > x) {
        next.add(ls.get(i));
      } else {
        prev.add(ls.get(i));
      }
    }
    if (next.size() >= prev.size()) {
      System.out.println(prev.size());
    } else {
      System.out.println(next.size());
    }
  }
}
