import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int number_n number_n i i count = 0; count 0 number_n = Integer.parseInt(sc.next()) number_n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] level = new int[number_n]; level new int[number_n] number_n for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next()); i = 0; i = 0 i 0 i < number_n i number_n i++ i++ i level[i] = Integer.parseInt(sc.next()); level[i] = Integer.parseInt(sc.next()) level[i] level i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(level) Arrays.sort Arrays level count = level[number_n/2] - level[number_n/2-1] count level[number_n/2] - level[number_n/2-1] level[number_n/2] level number_n/2 number_n 2 level[number_n/2-1] level number_n/2-1 number_n/2 number_n 2 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_n, i, count = 0;
    number_n = Integer.parseInt(sc.next());
    int[] level = new int[number_n];
    for(i = 0; i < number_n; i++) level[i] = Integer.parseInt(sc.next());
    Arrays.sort(level);
    count = level[number_n/2] - level[number_n/2-1];
    System.out.println(count);
  }
}
