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

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

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

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

	} main {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) final int NUM = scan.nextInt(); NUM scan.nextInt() scan.nextInt scan int[] nums = new int[NUM]; nums new int[NUM] NUM for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < NUM i NUM i++ i++ i {
			nums[i] = scan.nextInt();
		} {
			nums[i] = scan.nextInt();
		} nums[i] = scan.nextInt() nums[i] nums i scan.nextInt() scan.nextInt scan Arrays.sort(nums) Arrays.sort Arrays nums int answer = nums[NUM / 2] - nums[NUM / 2 - 1]; answer nums[NUM / 2] - nums[NUM / 2 - 1] nums[NUM / 2] nums NUM / 2 NUM 2 nums[NUM / 2 - 1] nums NUM / 2 - 1 NUM / 2 NUM 2 1 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		final int NUM = scan.nextInt();
		int[] nums = new int[NUM];
		for (int i = 0; i < NUM; i++) {
			nums[i] = scan.nextInt();
		}

		// check
		Arrays.sort(nums);
		int answer = nums[NUM / 2] - nums[NUM / 2 - 1];

		// answer
		System.out.println(answer);

	}
}
