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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

} import java.util.Arrays; Arrays 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.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	} main {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] d = new int[N]; d new int[N] N int idx; idx for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		} idx = 0; idx = 0 idx 0 idx < N idx N idx++ idx++ idx {
			d[idx] = Integer.parseInt(sc.next());
		} {
			d[idx] = Integer.parseInt(sc.next());
		} d[idx] = Integer.parseInt(sc.next()) d[idx] d idx Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(d) Arrays.sort Arrays d int low = d[N / 2 - 1]; low d[N / 2 - 1] d N / 2 - 1 N / 2 N 2 1 int high = d[N / 2]; high d[N / 2] d N / 2 N 2 System.out.println(high - low) System.out.println System.out System System.out high - low high low String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

}
