import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int[] d = new int[n]; d new int[n] n for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			d[i] = stdIn.nextInt();
		} {
			d[i] = stdIn.nextInt();
		} d[i] = stdIn.nextInt() d[i] d i stdIn.nextInt() stdIn.nextInt stdIn Arrays.sort(d) Arrays.sort Arrays d int cnt = 0; cnt 0 if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		} d.length%2!=0 d.length%2 d.length d d.length 2 0 {
			System.out.println(cnt);
		} System.out.println(cnt) System.out.println System.out System System.out cnt {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		} System.out.println(d[d.length/2]-d[d.length/2-1]) System.out.println System.out System System.out d[d.length/2]-d[d.length/2-1] d[d.length/2] d d.length/2 d.length d d.length 2 d[d.length/2-1] d d.length/2-1 d.length/2 d.length d d.length 2 1 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	}

} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //問題数
		
		int[] d = new int[n]; //難易度
		
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.sort(d);
		
		int cnt = 0;
		if(d.length%2!=0) {
			System.out.println(cnt);
		}else {
			System.out.println(d[d.length/2]-d[d.length/2-1]);
		}
		
	}

}
