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

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	}
		

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		} {
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int[]d = new int[N]; d new int[N] N for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
				d[i] = scan.nextInt();
			} {
				d[i] = scan.nextInt();
			} d[i] = scan.nextInt() d[i] d i scan.nextInt() scan.nextInt scan Arrays.sort(d) Arrays.sort Arrays d int s = d[N/2]-d[N/2-1]; s d[N/2]-d[N/2-1] d[N/2] d N/2 N 2 d[N/2-1] d N/2-1 N/2 N 2 1 System.out.println(s) System.out.println System.out System System.out s String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	}
		

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]d = new int[N];
			
			for(int i = 0;i<N;i++) {
				d[i] = scan.nextInt();
			}
			
			
			Arrays.sort(d);
			
			int s = d[N/2]-d[N/2-1];
			
			
			System.out.println(s);
			
			
			
			
			
		}
		
		
	}
		

}
