import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.HashSet;
import java.util.List;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int n = sc.nextInt();
        ArrayList<Integer> d = new ArrayList<>();
        for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        }
        Collections.sort(d);
        int len = d.size();
        int left = d.get(len/2-1);
        int right = d.get(len/2);
        int ans = right - left;
        System.out.println(ans);
    }
}

class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.TreeMap; TreeMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int n = sc.nextInt();
        ArrayList<Integer> d = new ArrayList<>();
        for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        }
        Collections.sort(d);
        int len = d.size();
        int left = d.get(len/2-1);
        int right = d.get(len/2);
        int ans = right - left;
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int n = sc.nextInt();
        ArrayList<Integer> d = new ArrayList<>();
        for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        }
        Collections.sort(d);
        int len = d.size();
        int left = d.get(len/2-1);
        int right = d.get(len/2);
        int ans = right - left;
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int n = sc.nextInt();
        ArrayList<Integer> d = new ArrayList<>();
        for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        }
        Collections.sort(d);
        int len = d.size();
        int left = d.get(len/2-1);
        int right = d.get(len/2);
        int ans = right - left;
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Library lib = new Library(); lib new Library() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc ArrayList<Integer> d = new ArrayList<>(); d new ArrayList<>() for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            d.add(sc.nextInt());
        } {
            d.add(sc.nextInt());
        } d.add(sc.nextInt()) d.add d sc.nextInt() sc.nextInt sc Collections.sort(d) Collections.sort Collections d int len = d.size(); len d.size() d.size d int left = d.get(len/2-1); left d.get(len/2-1) d.get d len/2-1 len/2 len 2 1 int right = d.get(len/2); right d.get(len/2) d.get d len/2 len 2 int ans = right - left; ans right - left right left System.out.println(ans) System.out.println System.out System System.out ans String[] args args class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
} Library static long a; a static long b; b public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    } gcd {
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    } Library lib = new Library(); lib new Library() if (a<b){
            lib.swap(a,b);
        } a<b a b {
            lib.swap(a,b);
        } lib.swap(a,b) lib.swap lib a b if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        } b==0 b 0 {
            return a;
        } return a; a {
            return gcd(b,a%b);
        } return gcd(b,a%b); gcd(b,a%b) gcd b a%b a b long a a long b b public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    } swap {
        long x = a;
        a = b;
        b = x;
        return;
    } long x = a; x a a = b a b b = x b x return; long a a long b b
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.HashSet;
import java.util.List;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Library lib = new Library();
        int n = sc.nextInt();
        ArrayList<Integer> d = new ArrayList<>();
        for (int i=0;i<n;i++){
            d.add(sc.nextInt());
        }
        Collections.sort(d);
        int len = d.size();
        int left = d.get(len/2-1);
        int right = d.get(len/2);
        int ans = right - left;
        System.out.println(ans);
    }
}

class Library{
    static long a;
    static long b;

    public static long gcd(long a,long b){
        Library lib = new Library();
        if (a<b){
            lib.swap(a,b);
        }
        if (b==0){
            return a;
        } else {
            return gcd(b,a%b);
        }
    }

    public static void swap(long a,long b){
        long x = a;
        a = b;
        b = x;
        return;
    }
}