import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    }
} import java.util.*; util.* java public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    } main {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int first = sc.nextInt(); first sc.nextInt() sc.nextInt sc int min = first; min first int max = first; max first List<Integer> di = new ArrayList<>(); di new ArrayList<>() di.add(first) di.add di first for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
    		int d = sc.nextInt();
    		di.add(d);
    	} {
    		int d = sc.nextInt();
    		di.add(d);
    	} int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc di.add(d) di.add di d Collections.sort(di) Collections.sort Collections di int harf1 = di.get(N/2 - 1); harf1 di.get(N/2 - 1) di.get di N/2 - 1 N/2 N 2 1 int harf2 = di.get(N/2); harf2 di.get(N/2) di.get di N/2 N 2 if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	} harf1 != harf2 harf1 harf2 {
    		System.out.println(harf2 - harf1);
    	} System.out.println(harf2 - harf1) System.out.println System.out System System.out harf2 - harf1 harf2 harf1 {
    		System.out.println(0);
    	} System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    }
} public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    }
} Main
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	int first = sc.nextInt();
    	int min = first;
    	int max = first;
    	List<Integer> di = new ArrayList<>();
    	di.add(first);
    	for (int i = 1; i < N; i++) {
    		int d = sc.nextInt();
    		di.add(d);
    	}
    	Collections.sort(di);
    	int harf1 = di.get(N/2 - 1);
    	int harf2 = di.get(N/2);
    	if (harf1 != harf2) {
    		System.out.println(harf2 - harf1);
    	} else {
    		System.out.println(0);
    	}
    }
}