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

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    } run {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] dArr = new int[n]; dArr new int[n] n for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            dArr[i] = sc.nextInt();
        } {
            dArr[i] = sc.nextInt();
        } dArr[i] = sc.nextInt() dArr[i] dArr i sc.nextInt() sc.nextInt sc Arrays.sort(dArr) Arrays.sort Arrays dArr int lower = dArr[n / 2 - 1]; lower dArr[n / 2 - 1] dArr n / 2 - 1 n / 2 n 2 1 int upper = dArr[n / 2]; upper dArr[n / 2] dArr n / 2 n 2 System.out.println(upper - lower) System.out.println System.out System System.out upper - lower upper lower void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    } debug {
        System.err.println(Arrays.deepToString(os));
    } System.err.println(Arrays.deepToString(os)) System.err.println System.err System System.err Arrays.deepToString(os) Arrays.deepToString Arrays os Object... os os public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main

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

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] dArr = new int[n];

        for (int i = 0; i < n; i++) {
            dArr[i] = sc.nextInt();
        }

        Arrays.sort(dArr);

        int lower = dArr[n / 2 - 1];
        int upper = dArr[n / 2];

        System.out.println(upper - lower);


        // write your code
//        System.out.println("Hello World");
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}
