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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    }
} 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 n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] d = new int[n]; d new int[n] n for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            d[i] = Integer.parseInt(sc.next());
        } {
            d[i] = Integer.parseInt(sc.next());
        } d[i] = Integer.parseInt(sc.next()) d[i] d i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(d) Arrays.sort Arrays d sc.close() sc.close sc int lower = d[n/2-1]; lower d[n/2-1] d n/2-1 n/2 n 2 1 int higher = d[n/2]; higher d[n/2] d n/2 n 2 System.out.println(higher-lower) System.out.println System.out System System.out higher-lower higher lower String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    }
} 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 n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i=0;i<n;i++){
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        sc.close();
        int lower = d[n/2-1];
        int higher = d[n/2];
        System.out.println(higher-lower);
    }
}