import java.util.Arrays;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






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

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    } main {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] d=new int[N]; d new int[N] N int mid=0; mid 0 int max=0; max 0 int min=100000; min 100000 for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        } {
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        } d[i]=sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc mid+=d[i] mid d[i] d i if(d[i]>max){
                max=d[i];
            } d[i]>max d[i] d i max {
                max=d[i];
            } max=d[i] max d[i] d i if(d[i]<min){
                min=d[i];
            } d[i]<min d[i] d i min {
                min=d[i];
            } min=d[i] min d[i] d i int[] e=d; e d Arrays.sort(e) Arrays.sort Arrays e mid=e[N/2-1] mid e[N/2-1] e N/2-1 N/2 N 2 1 int count=0; count 0 System.out.println(e[N/2]-e[N/2-1]) System.out.println System.out System System.out e[N/2]-e[N/2-1] e[N/2] e N/2 N 2 e[N/2-1] e N/2-1 N/2 N 2 1 String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    }
} Main
import java.util.Arrays;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int[] d=new int[N];
        int mid=0;
        int max=0;
        int min=100000;
        for(int i=0;i<N;i++){
            d[i]=sc.nextInt();
            mid+=d[i];
            if(d[i]>max){
                max=d[i];
            }
            if(d[i]<min){
                min=d[i];
            }
        }
        int[] e=d;
        Arrays.sort(e);

        mid=e[N/2-1];
        int count=0;










        System.out.println(e[N/2]-e[N/2-1]);






    }
}
