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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

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

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

  }
}

/*
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String blank = sc.nextLine();
String s = sc.nextLine();
System.out.println();
System.exit(0)
*/ 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

    for(int i = 0; i < m; i++){
      ary[i] = sc.nextInt();
      if(ary[i] < 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

    for(int i = 0; i < m; i++){
      ary[i] = sc.nextInt();
      if(ary[i] < 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

    for(int i = 0; i < m; i++){
      ary[i] = sc.nextInt();
      if(ary[i] < 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[] ary = new int[n+1]; ary new int[n+1] n+1 n 1 int left = 0; left 0 int right = 0; right 0 for(int i = 0; i < m; i++){
      ary[i] = sc.nextInt();
      if(ary[i] < x){left++;}
      else{right++;}
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      ary[i] = sc.nextInt();
      if(ary[i] < x){left++;}
      else{right++;}
    } {
      ary[i] = sc.nextInt();
      if(ary[i] < x){left++;}
      else{right++;}
    } ary[i] = sc.nextInt() ary[i] ary i sc.nextInt() sc.nextInt sc if(ary[i] < x){left++;}
      else{right++;} ary[i] < x ary[i] ary i 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

    for(int i = 0; i < m; i++){
      ary[i] = sc.nextInt();
      if(ary[i] < 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

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

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

  }
} 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[] ary = new int[n+1];
    int left = 0;
    int right = 0;

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

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

  }
}

/*
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String blank = sc.nextLine();
String s = sc.nextLine();
System.out.println();
System.exit(0)
*/
