
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[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

    }
} 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[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

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

        int N = scanner.nextInt();
        int[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

    } main {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int[] d = new int[N]; d new int[N] N for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            d[i] = scanner.nextInt();
        } {
            d[i] = scanner.nextInt();
        } d[i] = scanner.nextInt() d[i] d i scanner.nextInt() scanner.nextInt scanner Arrays.sort(d) Arrays.sort Arrays d int low = d[N / 2 - 1]; low d[N / 2 - 1] d N / 2 - 1 N / 2 N 2 1 int high = d[N / 2]; high d[N / 2] d N / 2 N 2 System.out.println(high - low) System.out.println System.out System System.out high - low high low String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

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

        int N = scanner.nextInt();
        int[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

    }
} 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[] d = new int[N];

        for (int i = 0 ; i < N ; i++) {
            d[i] = scanner.nextInt();
        }

        Arrays.sort(d);

        int low = d[N / 2 - 1];
        int high = d[N / 2];

        System.out.println(high - low);

    }
}
