
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    }
} Main public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    } main {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    } final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int[] n = new int[in.nextInt()]; n new int[in.nextInt()] in.nextInt() in.nextInt in for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        } int i = 0; int i = 0; i 0 i < n.length i n.length n n.length i++ i++ i {
            n[i] = in.nextInt();
        } {
            n[i] = in.nextInt();
        } n[i] = in.nextInt() n[i] n i in.nextInt() in.nextInt in Arrays.sort(n) Arrays.sort Arrays n final int left = n[n.length / 2 - 1]; left n[n.length / 2 - 1] n n.length / 2 - 1 n.length / 2 n.length n n.length 2 1 final int right = n[n.length / 2]; right n[n.length / 2] n n.length / 2 n.length n n.length 2 if (left == right) {
            System.out.println(0);
            return;
        } left == right left right {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; System.out.println(right - left) System.out.println System.out System System.out right - left right left String[] args args public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    }
} public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    }
} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] n = new int[in.nextInt()];
        for (int i = 0; i < n.length; i++) {
            n[i] = in.nextInt();
        }
        Arrays.sort(n);
        final int left = n[n.length / 2 - 1];
        final int right = n[n.length / 2];
        if (left == right) {
            System.out.println(0);
            return;
        }
        System.out.println(right - left);
    }
}
