import java.util.*;
public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    System.out.println(ans);
    
  }
} Main public static void main (String[] args) {
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    System.out.println(ans);
    
  } main {
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    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 ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int K = 0; K 0 for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    } {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc list.add(n) list.add list n K = Math.max(K,n) K Math.max(K,n) Math.max Math K n Collections.sort(list) Collections.sort Collections list int ans = 0; ans 0 for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    } int k=0; int k=0; k 0 k<=K k K k++ k++ k {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    } {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    } if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++; list.get(N/2) >= k && list.get(N/2-1) < k list.get(N/2) >= k list.get(N/2) list.get list N/2 N 2 k list.get(N/2-1) < k list.get(N/2-1) list.get list N/2-1 N/2 N 2 1 k ans++ ans 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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    System.out.println(ans);
    
  }
} public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    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();
    ArrayList<Integer> list = new ArrayList<Integer>();
    int K = 0;
    for (int i=0; i<N; i++) {
      int n = sc.nextInt();
      list.add(n);
      K = Math.max(K,n);
    }
    Collections.sort(list);
    int ans = 0;
    
    for (int k=0; k<=K; k++) {
      if (list.get(N/2) >= k && list.get(N/2-1) < k)
        ans++;    
    }
    
    System.out.println(ans);
    
  }
}