import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	}

	private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	}

	private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n = in.nextInt(); n in.nextInt() in.nextInt in int[] d = new int[n]; d new int[n] n for (int i = 0; i < n; i++)
			d[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i d[i] = in.nextInt(); d[i] = in.nextInt() d[i] d i in.nextInt() in.nextInt in System.out.println(solve(d)) System.out.println System.out System System.out solve(d) solve d in.close() in.close in String[] args args private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	} solve {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	} Arrays.sort(d) Arrays.sort Arrays d int m = d.length / 2; m d.length / 2 d.length d d.length 2 return d[m] - d[m - 1]; d[m] - d[m - 1] d[m] d m d[m - 1] d m - 1 m 1 int[] d d public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	}

	private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	}
} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	}

	private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++)
			d[i] = in.nextInt();
		System.out.println(solve(d));
		in.close();
	}

	private static int solve(int[] d) {
		Arrays.sort(d);
		int m = d.length / 2;
		return d[m] - d[m - 1];
	}
}
