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