import java.util.*;

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 count_1 = 0;
    int count_2 = 0;
    for(int i = 0; i < m; i++) {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    }
    System.out.println(Math.min(count_1, count_2));
  }
} import java.util.*; util.* java 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 count_1 = 0;
    int count_2 = 0;
    for(int i = 0; i < m; i++) {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    }
    System.out.println(Math.min(count_1, count_2));
  }
} 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 count_1 = 0;
    int count_2 = 0;
    for(int i = 0; i < m; i++) {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    }
    System.out.println(Math.min(count_1, count_2));
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int x = sc.nextInt();
    int count_1 = 0;
    int count_2 = 0;
    for(int i = 0; i < m; i++) {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    }
    System.out.println(Math.min(count_1, count_2));
  } 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 count_1 = 0; count_1 0 int count_2 = 0; count_2 0 for(int i = 0; i < m; i++) {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    } {
      int next = sc.nextInt();
      if(x > next) count_2++;
      if(x < next) count_1++;
    } int next = sc.nextInt(); next sc.nextInt() sc.nextInt sc if(x > next) count_2++; x > next x next count_2++ count_2 if(x < next) count_1++; x < next x next count_1++ count_1 System.out.println(Math.min(count_1, count_2)) System.out.println System.out System System.out Math.min(count_1, count_2) Math.min Math count_1 count_2 String[] args args
import java.util.*;

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