import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			list.add(sc.nextInt());
		} {
			list.add(sc.nextInt());
		} list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc Collections.sort(list) Collections.sort Collections list int sm = list.get((N/2)-1); sm list.get((N/2)-1) list.get list (N/2)-1 (N/2) N 2 1 int bi = list.get(N/2); bi list.get(N/2) list.get list N/2 N 2 int ans = 0; ans 0 if(sm == bi)ans = 0;
		else ans = bi - sm; sm == bi sm bi ans = 0 ans 0 ans = bi - sm ans bi - sm bi sm 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 sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i = 0; i < N; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);

		int sm = list.get((N/2)-1);
		int bi = list.get(N/2);

		int ans = 0;

		if(sm == bi)ans = 0;
		else ans = bi - sm;

		System.out.println(ans);
	}
}