import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	}
	static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	}
	static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array[i] = sc.nextInt();
		} {
			array[i] = sc.nextInt();
		} array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int ret = test(array); ret test(array) test array System.out.println(ret) System.out.println System.out System System.out ret sc.close() sc.close sc String[] args args static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	} test {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	} Arrays.sort(array) Arrays.sort Arrays array int p = array.length / 2; p array.length / 2 array.length array array.length 2 return array[p] - array[p - 1]; array[p] - array[p - 1] array[p] array p array[p - 1] array p - 1 p 1 int[] array array public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	}
	static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	}
	static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ret = test(array);
		System.out.println(ret);
		sc.close();
	}
	static int test(int[] array) {
		Arrays.sort(array);
		int p = array.length / 2;
		return array[p] - array[p - 1];
	}
}