import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	}
}; import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Integer Array[] = new Integer[N]; Array new Integer[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 Arrays.sort(Array) Arrays.sort Arrays Array if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		} Array[N/2-1]==Array[N/2] Array[N/2-1] Array N/2-1 N/2 N 2 1 Array[N/2] Array N/2 N 2 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			System.out.println(Array[N/2]-Array[N/2-1]);
		} System.out.println(Array[N/2]-Array[N/2-1]) System.out.println System.out System System.out Array[N/2]-Array[N/2-1] Array[N/2] Array N/2 N 2 Array[N/2-1] Array N/2-1 N/2 N 2 1 sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	}
} Main
import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		Integer Array[] = new Integer[N];
		for(int i = 0; i < N; i++){
			Array[i] = sc.nextInt();
		}
		Arrays.sort(Array);
		if(Array[N/2-1]==Array[N/2]){
			System.out.println(0);
		}else{
			System.out.println(Array[N/2]-Array[N/2-1]);
		}
		sc.close();
	}
};