import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    } main {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = scan.nextInt();
        } {
            array[i] = scan.nextInt();
        } array[i] = scan.nextInt() array[i] array i scan.nextInt() scan.nextInt scan Arrays.sort(array) Arrays.sort Arrays array int half = array.length / 2; half array.length / 2 array.length array array.length 2 if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        } array[half - 1] == array[half] array[half - 1] array half - 1 half 1 array[half] array half {

            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; int ans = 0; ans 0 System.out.println(array[half] - array[half - 1]) System.out.println System.out System System.out array[half] - array[half - 1] array[half] array half array[half - 1] array half - 1 half 1 String[] args args public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    }
} public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];

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

        Arrays.sort(array);

        int half = array.length / 2;

        if (array[half - 1] == array[half]) {

            System.out.println(0);
            return;
        }

        int ans = 0;
        System.out.println(array[half] - array[half - 1]);

    }
}