import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	}


} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	}


} Main public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	} main {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String W = in.readLine(); W in.readLine() in.readLine in int N = Integer.parseInt(W); N Integer.parseInt(W) Integer.parseInt Integer W W = in.readLine() W in.readLine() in.readLine in String[] D = W.split(" "); D W.split(" ") W.split W " " int[] d = new int[D.length]; d new int[D.length] D.length D D.length for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		} int i=0; int i=0; i 0 i<d.length i d.length d d.length i++ i++ i {
			d[i]=Integer.parseInt(D[i]);
		} {
			d[i]=Integer.parseInt(D[i]);
		} d[i]=Integer.parseInt(D[i]) d[i] d i Integer.parseInt(D[i]) Integer.parseInt Integer D[i] D i Arrays.sort(d) Arrays.sort Arrays d int l = N/2 -1 ; l N/2 -1 N/2 N 2 1 int r = N/2; r N/2 N 2 int ans = d[r] - d[l] ; ans d[r] - d[l] d[r] d r d[l] d l if(ans <= 0){
			ans =0;
		} ans <= 0 ans 0 {
			ans =0;
		} ans =0 ans 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	}


} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	}


} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int N = Integer.parseInt(W);

		W = in.readLine();
		String[] D = W.split(" ");

		int[] d = new int[D.length];
		for(int i=0;i<d.length;i++){
			d[i]=Integer.parseInt(D[i]);
		}
		Arrays.sort(d);

		int l = N/2 -1 ;
		int r = N/2;

		int ans = d[r] - d[l] ;

		if(ans <= 0){
			ans =0;
		}
		System.out.println(ans);

	}


}
