import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  }
} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  } main {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan List<Integer> list = new ArrayList<>(N); list new ArrayList<>(N) for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      list.add(scan.nextInt());
    } {
      list.add(scan.nextInt());
    } list.add(scan.nextInt()) list.add list scan.nextInt() scan.nextInt scan Collections.sort(list) Collections.sort Collections list System.out.println(list.get(N / 2) - list.get(N / 2 - 1)) System.out.println System.out System System.out list.get(N / 2) - list.get(N / 2 - 1) list.get(N / 2) list.get list N / 2 N 2 list.get(N / 2 - 1) list.get list N / 2 - 1 N / 2 N 2 1 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    List<Integer> list = new ArrayList<>(N);

    for (int i = 0; i < N; i++) {
      list.add(scan.nextInt());
    }

    Collections.sort(list);
    System.out.println(list.get(N / 2) - list.get(N / 2 - 1));
  }
}
