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

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

} Main /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  } main {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] numbers = new int[n]; numbers new int[n] n for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      numbers[i] = Integer.parseInt(sc.next());
    } {
      numbers[i] = Integer.parseInt(sc.next());
    } numbers[i] = Integer.parseInt(sc.next()) numbers[i] numbers i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(numbers) Arrays.sort Arrays numbers if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    } numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1] numbers[numbers.length / 2] numbers numbers.length / 2 numbers.length numbers numbers.length 2 numbers[(numbers.length / 2) - 1] numbers (numbers.length / 2) - 1 (numbers.length / 2) numbers.length numbers numbers.length 2 1 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    } System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]) System.out.println System.out System System.out numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1] numbers[numbers.length / 2] numbers numbers.length / 2 numbers.length numbers numbers.length 2 numbers[(numbers.length / 2) - 1] numbers (numbers.length / 2) - 1 (numbers.length / 2) numbers.length numbers numbers.length 2 1 String[] args args public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

} public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

} Main
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] numbers = new int[n];
    for (int i = 0; i < n; i++) {
      numbers[i] = Integer.parseInt(sc.next());
    }

    Arrays.sort(numbers);

    if (numbers[numbers.length / 2] == numbers[(numbers.length / 2) - 1]) {
      System.out.println(0);
    } else {
      System.out.println(numbers[numbers.length / 2] - numbers[(numbers.length / 2) - 1]);
    }

  }

}
