import java.util.Arrays;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] d = new int[n];
    for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    }
    sc.close();

    if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    }
  }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] d = new int[n];
    for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    }
    sc.close();

    if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] d = new int[n];
    for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    }
    sc.close();

    if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] d = new int[n];
    for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    }
    sc.close();

    if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] d = new int[n]; d new int[n] n for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      d[i] = sc.nextInt();
    } {
      d[i] = sc.nextInt();
    } d[i] = sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc sc.close() sc.close sc if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    } n % 2 == 1 n % 2 n 2 1 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    } Arrays.sort(d) Arrays.sort Arrays d int min = d[d.length / 2 - 1]; min d[d.length / 2 - 1] d d.length / 2 - 1 d.length / 2 d.length d d.length 2 1 int max = d[d.length / 2]; max d[d.length / 2] d d.length / 2 d.length d d.length 2 System.out.println(max - min) System.out.println System.out System System.out max - min max min String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] d = new int[n];
    for (int i = 0; i < n; i++) {
      d[i] = sc.nextInt();
    }
    sc.close();

    if (n % 2 == 1) {
      System.out.println(0);
    } else {
      Arrays.sort(d);
      int min = d[d.length / 2 - 1];
      int max = d[d.length / 2];
      System.out.println(max - min);
    }
  }
}
