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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	}
} import java.util.Arrays; Arrays 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) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.nextLine()); N Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String[] spl = s.split(" "); spl s.split(" ") s.split s " " Integer[] d = new Integer[N]; d new Integer[N] N for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			d[i] = Integer.parseInt(spl[i]);
		} {
			d[i] = Integer.parseInt(spl[i]);
		} d[i] = Integer.parseInt(spl[i]) d[i] d i Integer.parseInt(spl[i]) Integer.parseInt Integer spl[i] spl i sc.close() sc.close sc Arrays.sort(d,Collections.reverseOrder()) Arrays.sort Arrays d Collections.reverseOrder() Collections.reverseOrder Collections System.out.println(d[(N/2) - 1] - d[N/2]) System.out.println System.out System System.out d[(N/2) - 1] - d[N/2] d[(N/2) - 1] d (N/2) - 1 (N/2) N 2 1 d[N/2] d N/2 N 2 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	}
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String s = sc.nextLine();
		String[] spl = s.split(" ");
		Integer[] d = new Integer[N];
		for(int i = 0;i < N;i++){
			d[i] = Integer.parseInt(spl[i]);
		}
		sc.close();
		Arrays.sort(d,Collections.reverseOrder());
		System.out.println(d[(N/2) - 1] - d[N/2]);
	}
}