import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
 
 
public class Main {

	static long MOD = 1_000_000_007;
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	}
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	static long MOD = 1_000_000_007;
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	}
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
} Main static long MOD = 1_000_000_007; MOD 1_000_000_007 public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	} main {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	} int INF = Integer.MAX_VALUE; INF Integer.MAX_VALUE Integer Integer.MAX_VALUE 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[] d = new int[N]; d new int[N] N for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			d[i] = Integer.parseInt(sc.next());
		} {
			d[i] = Integer.parseInt(sc.next());
		} d[i] = Integer.parseInt(sc.next()) d[i] d i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(d) Arrays.sort Arrays d int low = d[N/2-1]; low d[N/2-1] d N/2-1 N/2 N 2 1 int high = d[N/2]; high d[N/2] d N/2 N 2 System.out.println(high-low) System.out.println System.out System System.out high-low high low String[] args args static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	} lcm {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	} long temp; temp long c = a; c a c *= b c b while((temp = a%b)!=0) {
			a = b;
			b = temp;
		} (temp = a%b)!=0 (temp = a%b) temp a%b a b 0 {
			a = b;
			b = temp;
		} a = b a b b = temp b temp return (c/b); (c/b) c b long a a long b b public class Main {

	static long MOD = 1_000_000_007;
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	}
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
} public class Main {

	static long MOD = 1_000_000_007;
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	}
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
 
 
public class Main {

	static long MOD = 1_000_000_007;
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		//int N = Integer.parseInt(sc.next());
		//long L = Long.parseLong(sc.next());
		int INF = Integer.MAX_VALUE;
		Scanner sc = new Scanner(System.in);
		//char[] c = sc.next().toCharArray();
		//int N = A.length;
		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];
		for(int i=0; i<N; i++){
			d[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(d);
		
		int low = d[N/2-1];
		int high = d[N/2];
		
		System.out.println(high-low);
		
	}
	static long lcm (long a, long b) {
		long temp;
		long c = a;
		c *= b;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return (c/b);
	}
}

