import java.util.Scanner;

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 left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  }
} import java.util.Scanner; Scanner 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 left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  }
} 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 left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  } main {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    int left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

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

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  }
} 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 left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  }
} Main
import java.util.Scanner;

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 left = 0;
    int right = 0;

    for (int i = 0; i < m; i++) {
      int a = sc.nextInt();
      if (a < x) {
        left++;
      } else {
        right++;
      }
    }

    System.out.println(Math.min(left, right));

  }
}