import java.util.*;
public class Main {

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

	}

} import java.util.*; util.* java public class Main {

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

	}

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

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int [] arr = new int [n];
		for(int i=0;i<n;i++)
			arr[i]=sc.nextInt();
		Arrays.sort(arr);
		int x = n/2;
		int y = n/2-1;
		x = arr[x];
		y=arr[y];
		
		System.out.println(x-y);
		

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int [] arr = new int [n]; arr new int [n] n for(int i=0;i<n;i++)
			arr[i]=sc.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i 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 x = n/2; x n/2 n 2 int y = n/2-1; y n/2-1 n/2 n 2 1 x = arr[x] x arr[x] arr x y=arr[y] y arr[y] arr y System.out.println(x-y) System.out.println System.out System System.out x-y x y String[] args args public class Main {

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

	}

} public class Main {

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

	}

} Main
import java.util.*;
public class Main {

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

	}

}
