import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	}
}
	 import java.util.*; util.* java import java.io.*; io.* java public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	}
} Main public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	} main {
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt(); n in.nextInt() in.nextInt in int [] p=new int [n]; p new int [n] n for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			p[i]=in.nextInt();
		} {
			p[i]=in.nextInt();
		} p[i]=in.nextInt() p[i] p i in.nextInt() in.nextInt in int ans=0; ans 0 Arrays.sort(p) Arrays.sort Arrays p System.out.println(p[n/2]-p[n/2-1]) System.out.println System.out System System.out p[n/2]-p[n/2-1] p[n/2] p n/2 n 2 p[n/2-1] p 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();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	}
} public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);		
		int n=in.nextInt();
		int [] p=new int [n];
		for(int i=0;i<n;i++)
		{
			p[i]=in.nextInt();
		}
		int ans=0;
		Arrays.sort(p);
		System.out.println(p[n/2]-p[n/2-1]);
	}
} Main
import java.util.*;
import java.io.*;

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