import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	}
} import java.util.*; util.* java import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Integer.*; public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	}
} Main public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	} main {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	} int i i j; j Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = parseInt(sc.next()); n parseInt(sc.next()) parseInt sc.next() sc.next sc int[] d = new int[n]; d new int[n] n for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			d[i] = parseInt(sc.next());
		} {
			d[i] = parseInt(sc.next());
		} d[i] = parseInt(sc.next()) d[i] d i parseInt(sc.next()) parseInt sc.next() sc.next sc sc.close() sc.close sc Arrays.sort(d) Arrays.sort Arrays d System.out.println(d[n/2]-d[n/2-1]) System.out.println System.out System System.out d[n/2]-d[n/2-1] d[n/2] d n/2 n 2 d[n/2-1] d n/2-1 n/2 n 2 1 String[] args args public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	}
} public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	}
} Main
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int[] d = new int[n];
		for(i=0;i<n;i++) {
			d[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(d);
		System.out.println(d[n/2]-d[n/2-1]);
	}
}
