import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	}
} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	} main {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner String[] temp = scanner.nextLine().split(" "); temp scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int[] list = new int[n]; list new int[n] n for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			list[i] = Integer.parseInt(temp[i]);

		} {

			list[i] = Integer.parseInt(temp[i]);

		} list[i] = Integer.parseInt(temp[i]) list[i] list i Integer.parseInt(temp[i]) Integer.parseInt Integer temp[i] temp i Arrays.sort(list) Arrays.sort Arrays list int a = list[n / 2]; a list[n / 2] list n / 2 n 2 int b = list[n / 2 - 1]; b list[n / 2 - 1] list n / 2 - 1 n / 2 n 2 1 System.out.println(a - b) System.out.println System.out System System.out a - b a b String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	}
} public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		String[] temp = scanner.nextLine().split(" ");
		int[] list = new int[n];

		for(int i = 0; i < n; i++) {

			list[i] = Integer.parseInt(temp[i]);

		}

		Arrays.sort(list);



		int a = list[n / 2];
		int b = list[n / 2 - 1];

		System.out.println(a - b);


	}
}
