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

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


//1 4 4 6 7 9
//
//1 4 4 5 5 9 14 14
 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 nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		int nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	} main {
		Scanner sc=new Scanner(System.in);
		
		int nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int nums=sc.nextInt(); nums sc.nextInt() sc.nextInt sc int[] arr=new int[nums]; arr new int[nums] nums for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<nums i nums i++ i++ i {
			arr[i]=sc.nextInt();
		} {
			arr[i]=sc.nextInt();
		} arr[i]=sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc Arrays.sort(arr) Arrays.sort Arrays arr int count=arr[nums/2]-arr[nums/2-1]; count arr[nums/2]-arr[nums/2-1] arr[nums/2] arr nums/2 nums 2 arr[nums/2-1] arr nums/2-1 nums/2 nums 2 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		int nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		int nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	}
} 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 nums=sc.nextInt();
		int[] arr=new int[nums];
		for(int i=0;i<nums;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		
		int count=arr[nums/2]-arr[nums/2-1];
		System.out.println(count);
	}
}


//1 4 4 6 7 9
//
//1 4 4 5 5 9 14 14

