import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    }
 
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    }
 
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    } main {
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int[] a = new int[k]; a new int[k] k int ans = 0; ans 0 for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < k i k i ++ i ++ i {
        	a[i] = scan.nextInt();
        } {
        	a[i] = scan.nextInt();
        } a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan Arrays.sort(a) Arrays.sort Arrays a int b = k / 2; b k / 2 k 2 if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        } a[b - 1] == a[b] a[b - 1] a b - 1 b 1 a[b] a b {
        	ans = 0;
        } ans = 0 ans 0 {
        	ans = a[b] - a[b-1] ;
        } ans = a[b] - a[b-1] ans a[b] - a[b-1] a[b] a b a[b-1] a b-1 b 1 System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    }
 
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    }
 
} Main
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int k = scan.nextInt();
      	int[] a = new int[k];
      	int ans = 0;
      	for(int i = 0; i < k; i ++){
        	a[i] = scan.nextInt();
        }
      	Arrays.sort(a);
      	int b = k / 2;
      	if(a[b - 1] == a[b]){
        	ans = 0;
        }
      	else{
        	ans = a[b] - a[b-1] ;
        }
      	System.out.print(ans);
    }
 
}