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

public class Main {

	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	}

} Main public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	} main {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int d[] = new int[n]; d new int[n] n for(int i = 0; i < n; i++)
			d[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i d[i] = in.nextInt(); d[i] = in.nextInt() d[i] d i in.nextInt() in.nextInt in Arrays.sort(d) Arrays.sort Arrays d int hrf = d.length/2-1; hrf d.length/2-1 d.length/2 d.length d d.length 2 1 if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		} d[hrf] == d[hrf+1] d[hrf] d hrf d[hrf+1] d hrf+1 hrf 1 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; int ans = d[hrf+1] - d[hrf]; ans d[hrf+1] - d[hrf] d[hrf+1] d hrf+1 hrf 1 d[hrf] d hrf 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){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	}

} Main

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

public class Main {

	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int d[] = new int[n];

		//ABC < K    k <= ARC

		for(int i = 0; i < n; i++)
			d[i] = in.nextInt();

		Arrays.sort(d);

		int hrf = d.length/2-1;

		if(d[hrf] == d[hrf+1]) {
			System.out.println(0);
			return;
		}

		int ans = d[hrf+1] - d[hrf];


		System.out.println(ans);
	}

}