import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.List;

public class Main {
    public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    }

}
 import java.awt.*; awt.* java import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java import java.util.List; List java.util public class Main {
    public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    }

} Main public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    } 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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    } 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]=sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc Arrays.sort(arr) Arrays.sort Arrays arr int x=1; x 1 int index=n/2 -1 ; index n/2 -1 n/2 n 2 1 if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        } arr[index]==arr[index+1] arr[index] arr index arr[index+1] arr index+1 index 1 {
            x=0;
        } x=0 x 0 {
            x=arr[index+1]-arr[index];
        } x=arr[index+1]-arr[index] x arr[index+1]-arr[index] arr[index+1] arr index+1 index 1 arr[index] arr index System.out.println(x) System.out.println System.out System System.out x String args[] args public class Main {
    public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    }

} public class Main {
    public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    }

} Main
import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.List;

public class Main {
    public static void main(String args[]) throws IOException {
        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=1;
        int index=n/2 -1 ;
        if (arr[index]==arr[index+1]){
            x=0;
        }else {
            x=arr[index+1]-arr[index];
        }
        System.out.println(x);

    }

}

