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 x = sc.nextInt();
    int cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  }
} 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 x = sc.nextInt();
    int cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  }
} 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 cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    int cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  } 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 cost_n = 0; cost_n 0 for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    } {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    } int am = sc.nextInt(); am sc.nextInt() sc.nextInt sc if (am > x) {
        cost_n++;
      } am > x am x {
        cost_n++;
      } cost_n++ cost_n System.out.println(Math.min(cost_n, m - cost_n)) System.out.println System.out System System.out Math.min(cost_n, m - cost_n) Math.min Math cost_n m - cost_n m cost_n 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 cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  }
} 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 cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  }
} 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 x = sc.nextInt();
    int cost_n = 0;

    for (int i = 0; i < m; i++) {
      int am = sc.nextInt();
      if (am > x) {
        cost_n++;
      }
    }

    System.out.println(Math.min(cost_n, m - cost_n));
  }
}
