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