import 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 start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  } 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 start = sc.nextInt(); start sc.nextInt() sc.nextInt sc int[] cost = new int[M]; cost new int[M] M int  countMin = 0; countMin 0 int countMax = 0; countMax 0 for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    } {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    } cost[i] = sc.nextInt() cost[i] cost i sc.nextInt() sc.nextInt sc if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } cost[i] >= start cost[i] cost i start {
        countMax++;
      } countMax++ countMax {
        countMin++;
      } countMin++ countMin System.out.println(Math.min(countMin, countMax)) System.out.println System.out System System.out Math.min(countMin, countMax) Math.min Math countMin countMax 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 start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  }
} Main
import 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 start = sc.nextInt();
    int[] cost = new int[M];
    int  countMin = 0;
    int countMax = 0;
    for (int i = 0; i < M; i++) {
      cost[i] = sc.nextInt();
      if (cost[i] >= start) {
        countMax++;
      } else {
        countMin++;
      } 
    }
    System.out.println(Math.min(countMin, countMax));
  }
}