import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

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

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