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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  }
}
    
    
     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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  }
} 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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int X = sc.nextInt();
    int A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  } 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 A[] = new int [M]; A new int [M] M int left = 0; left 0 for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    } int i=0; int i=0; i 0 i<M i M i++ i++ i {
      if(sc.nextInt()<X){
        left++;
      }
    } {
      if(sc.nextInt()<X){
        left++;
      }
    } if(sc.nextInt()<X){
        left++;
      } sc.nextInt()<X sc.nextInt() sc.nextInt sc X {
        left++;
      } left++ left System.out.println(Math.min(left, M-left)) System.out.println System.out System System.out Math.min(left, M-left) Math.min Math left M-left M left 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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  }
} 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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  }
} 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 A[] = new int [M];
    int left = 0;
    for(int i=0;i<M;i++){
      if(sc.nextInt()<X){
        left++;
      }
    }
    System.out.println(Math.min(left, M-left));
  }
}
    
    
    