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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	} main {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] nums = new int[N]; nums new int[N] N for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
			nums[i] = sc.nextInt();
		} {
			nums[i] = sc.nextInt();
		} nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc Arrays.sort(nums) Arrays.sort Arrays nums if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		} !(nums[nums.length/2]-nums[nums.length/2-1]==0) (nums[nums.length/2]-nums[nums.length/2-1]==0) nums[nums.length/2]-nums[nums.length/2-1] nums[nums.length/2] nums nums.length/2 nums.length nums nums.length 2 nums[nums.length/2-1] nums nums.length/2-1 nums.length/2 nums.length nums nums.length 2 1 0 {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		} System.out.println(nums[nums.length/2]-nums[nums.length/2-1]) System.out.println System.out System System.out nums[nums.length/2]-nums[nums.length/2-1] nums[nums.length/2] nums nums.length/2 nums.length nums nums.length 2 nums[nums.length/2-1] nums nums.length/2-1 nums.length/2 nums.length nums nums.length 2 1 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	}

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int[] nums = new int[N];
		for(int i = 0; i< N ; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		if(!(nums[nums.length/2]-nums[nums.length/2-1]==0)) {
			System.out.println(nums[nums.length/2]-nums[nums.length/2-1]);
		}else {
			System.out.println(0);
		}
	}

}
