import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int m = Integer.parseInt(str[1]); m Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int x = Integer.parseInt(str[2]); x Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 String[] a = in.readLine().split(" "); a in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int count = 0; count 0 for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    } int i=0; int i=0; i 0 i<m i m i++ i++ i {
      if(x<Integer.parseInt(a[i]))
        count++;
    } {
      if(x<Integer.parseInt(a[i]))
        count++;
    } if(x<Integer.parseInt(a[i]))
        count++; x<Integer.parseInt(a[i]) x Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i count++ count System.out.println(Math.min(count,m-count)) System.out.println System.out System System.out Math.min(count,m-count) Math.min Math count m-count m count String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int m = Integer.parseInt(str[1]);
    int x = Integer.parseInt(str[2]);
    String[] a = in.readLine().split(" ");
    int count = 0;
    for(int i=0; i<m; i++) {
      if(x<Integer.parseInt(a[i]))
        count++;
    }
    System.out.println(Math.min(count,m-count));
  }
}