import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	}

} import java.util.Arrays; Arrays 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();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] arr = new int[n]; arr new int[n] n for(int i = 0;i<n;i++)arr[i]=sc.nextInt(); int i = 0; int i = 0; i 0 i<n i n i++ i++ i arr[i]=sc.nextInt(); arr[i]=sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc Arrays.sort(arr) Arrays.sort Arrays arr int bot = arr[n/2-1]; bot arr[n/2-1] arr n/2-1 n/2 n 2 1 int top = arr[(n/2)]; top arr[(n/2)] arr (n/2) n 2 System.out.println(top-bot) System.out.println System.out System System.out top-bot top bot String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0;i<n;i++)arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int bot = arr[n/2-1];;
		int top = arr[(n/2)];
		System.out.println(top-bot);
	}

}
