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

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

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

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

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

} Main

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

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

}
