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

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] d = new int[n]; d new int[n] n int i; i for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		} i = 0; i = 0 i 0 i < n i n i++ i++ i {
			d[i] = scan.nextInt();
		} {
			d[i] = scan.nextInt();
		} d[i] = scan.nextInt() d[i] d i scan.nextInt() scan.nextInt scan Arrays.sort(d) Arrays.sort Arrays d int low = n / 2 - 1; low n / 2 - 1 n / 2 n 2 1 int hi = n / 2; hi n / 2 n 2 int ans; ans if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		} d[low] == d[hi] d[low] d low d[hi] d hi {
			ans = 0;
		} ans = 0 ans 0 {
			ans = d[hi] - d[low];
		} ans = d[hi] - d[low] ans d[hi] - d[low] d[hi] d hi d[low] d low System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] d = new int[n];
		int i;
		for(i = 0; i < n; i++) {
			d[i] = scan.nextInt();
		}
		Arrays.sort(d);

		int low = n / 2 - 1;
		int hi = n / 2;

		int ans;
		if(d[low] == d[hi]) {
			ans = 0;
		}else {
			ans = d[hi] - d[low];
		}
		System.out.println(ans);
	}
}