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

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int N  = keyboard.nextInt(); N keyboard.nextInt() keyboard.nextInt keyboard int[]score = new int[N]; score new int[N] N for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		} int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
			score[i] = keyboard.nextInt();
		} {
			score[i] = keyboard.nextInt();
		} score[i] = keyboard.nextInt() score[i] score i keyboard.nextInt() keyboard.nextInt keyboard Arrays.sort(score) Arrays.sort Arrays score int ans = 0; ans 0 if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		} score[N/2] == score[N/2-1] score[N/2] score N/2 N 2 score[N/2-1] score N/2-1 N/2 N 2 1 {
			ans = 0;
		} ans = 0 ans 0 {
			ans = score[N/2] - score[N/2-1];
		} ans = score[N/2] - score[N/2-1] ans score[N/2] - score[N/2-1] score[N/2] score N/2 N 2 score[N/2-1] score N/2-1 N/2 N 2 1 System.out.print(ans) System.out.print System.out System System.out ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N  = keyboard.nextInt();
		int[]score = new int[N];
		
		for(int i = 0; i< N; i++) {
			score[i] = keyboard.nextInt();
		}
		Arrays.sort(score);
		int ans = 0;

		if(score[N/2] == score[N/2-1]) {
			ans = 0;
		}else{
			ans = score[N/2] - score[N/2-1];
		}

		System.out.print(ans);
		keyboard.close();	
	}
}
