import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	static BufferedReader reader;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	}

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	static BufferedReader reader;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	}

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
} Main static BufferedReader reader; reader public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	} main {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	} reader = new BufferedReader(new InputStreamReader(System.in)) reader new BufferedReader(new InputStreamReader(System.in)) String[] s = readLine(); s readLine() readLine int[] nums = new int[Integer.parseInt(s[0])]; nums new int[Integer.parseInt(s[0])] Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 s = readLine() s readLine() readLine for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		} int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
			nums[i]=Integer.parseInt(s[i]);
		} {
			nums[i]=Integer.parseInt(s[i]);
		} nums[i]=Integer.parseInt(s[i]) nums[i] nums i Integer.parseInt(s[i]) Integer.parseInt Integer s[i] s i Arrays.sort(nums) Arrays.sort Arrays nums int N = nums.length; N nums.length nums nums.length print(nums[N/2]-nums[N/2-1]) print nums[N/2]-nums[N/2-1] nums[N/2] nums N/2 N 2 nums[N/2-1] nums N/2-1 N/2 N 2 1 String[] args args private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	} readLine {
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	} try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		} catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		} Exception e {
			e.printStackTrace();
			return new String[]{e.getMessage()};
		} e.printStackTrace() e.printStackTrace e return new String[]{e.getMessage()}; new String[]{e.getMessage()} {
			return reader.readLine().split(" ");
		} return reader.readLine().split(" "); reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " private static void print(Object o){
		System.out.println(o);
	} print {
		System.out.println(o);
	} System.out.println(o) System.out.println System.out System System.out o Object o o private static void print(){
		System.out.println();
	} print {
		System.out.println();
	} System.out.println() System.out.println System.out System System.out public class Main {

	static BufferedReader reader;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	}

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
} public class Main {

	static BufferedReader reader;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	}

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	static BufferedReader reader;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		String[] s = readLine();
		int[] nums = new int[Integer.parseInt(s[0])];
		s = readLine();
		for(int i=0;i<s.length;i++) {
			nums[i]=Integer.parseInt(s[i]);
		}
		Arrays.sort(nums);
		int N = nums.length;
		print(nums[N/2]-nums[N/2-1]);
	}

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
}
