import java.util.*;

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

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