import java.util.Arrays;
import java.util.Scanner;
import java.util.InputMismatchException;

public class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.InputMismatchException; InputMismatchException java.util public class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	}
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	} main {
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String inputN = scanner.nextLine(); inputN scanner.nextLine() scanner.nextLine scanner String inputP = scanner.nextLine(); inputP scanner.nextLine() scanner.nextLine scanner String[] pStr = inputP.split(" ", 0); pStr inputP.split(" ", 0) inputP.split inputP " " 0 int n = Integer.parseInt(inputN); n Integer.parseInt(inputN) Integer.parseInt Integer inputN int pInt[] = new int[n]; pInt new int[n] n for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			pInt[i] = Integer.parseInt(pStr[i]);
		} {
			pInt[i] = Integer.parseInt(pStr[i]);
		} pInt[i] = Integer.parseInt(pStr[i]) pInt[i] pInt i Integer.parseInt(pStr[i]) Integer.parseInt Integer pStr[i] pStr i Arrays.sort(pInt) Arrays.sort Arrays pInt System.out.println(pInt[n/2] - pInt[n/2-1]) System.out.println System.out System System.out pInt[n/2] - pInt[n/2-1] pInt[n/2] pInt n/2 n 2 pInt[n/2-1] pInt n/2-1 n/2 n 2 1 String[] args args public class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.InputMismatchException;

public class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String inputN = scanner.nextLine();
		
		String inputP = scanner.nextLine();
		String[] pStr = inputP.split(" ", 0);
		
		int n = Integer.parseInt(inputN);
		int pInt[] = new int[n];
		for(int i=0;i<n;i++){
			pInt[i] = Integer.parseInt(pStr[i]);
		}
		
		Arrays.sort(pInt);
		
		System.out.println(pInt[n/2] - pInt[n/2-1]);
	}
}