import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	}
} Main public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	} main {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) int N=stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int d[]=new int[N]; d new int[N] N int z=0; z 0 while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		} z<N z N {
			d[z]=stdIn.nextInt();
			z++;
		} d[z]=stdIn.nextInt() d[z] d z stdIn.nextInt() stdIn.nextInt stdIn z++ z z=0 z 0 Arrays.sort(d) Arrays.sort Arrays d System.out.println(d[N/2]-d[N/2-1]) System.out.println System.out System System.out d[N/2]-d[N/2-1] d[N/2] d N/2 N 2 d[N/2-1] d N/2-1 N/2 N 2 1 String[] args args public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	}
} public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int d[]=new int[N];
		int z=0;
		while(z<N){
			d[z]=stdIn.nextInt();
			z++;
		}z=0;
		Arrays.sort(d);
		System.out.println(d[N/2]-d[N/2-1]);
	}
}