import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	}
 
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	}
 
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer>difficulty=new ArrayList<>(); difficulty new ArrayList<>() int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int halfLine; halfLine for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			difficulty.add(sc.nextInt());
		} {
			difficulty.add(sc.nextInt());
		} difficulty.add(sc.nextInt()) difficulty.add difficulty sc.nextInt() sc.nextInt sc Collections.sort(difficulty) Collections.sort Collections difficulty halfLine=difficulty.size()/2 halfLine difficulty.size()/2 difficulty.size() difficulty.size difficulty 2 int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1); result difficulty.get(halfLine)-difficulty.get(halfLine-1) difficulty.get(halfLine) difficulty.get difficulty halfLine difficulty.get(halfLine-1) difficulty.get difficulty halfLine-1 halfLine 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	}
 
} public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	}
 
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner sc=new Scanner(System.in);
		ArrayList<Integer>difficulty=new ArrayList<>();
		
		//問題数
		int N=sc.nextInt();
		
		int halfLine;
		
		//問題の難易度
		for(int i=0;i<N;i++) {
			difficulty.add(sc.nextInt());
		}
		
		Collections.sort(difficulty);	
		halfLine=difficulty.size()/2;
	
		int result=
				difficulty.get(halfLine)-difficulty.get(halfLine-1);
		
		
		System.out.println(result);
	}
 
}