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];
    for(int i = 0;i<m;i++){
      a[i] = sc.nextInt();
    }

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

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

    int mae = 0;
    int usiro = 0;
    for(int i = 0;i<m;i++){
      if(a[i] < x){
        mae++;
      }else{
        usiro++;
      }
    }
    int ans = Math.min(mae,usiro);
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    int[] a = new int[m];
    for(int i = 0;i<m;i++){
      a[i] = sc.nextInt();
    }

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

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

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

    int mae = 0;
    int usiro = 0;
    for(int i = 0;i<m;i++){
      if(a[i] < x){
        mae++;
      }else{
        usiro++;
      }
    }
    int ans = Math.min(mae,usiro);
    System.out.println(ans);
  }
}
