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

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    }

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

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }
} Main private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    } solve {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int [] d = new int[N]; d new int[N] N for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            d[i] = sc.nextInt();
        } {
            d[i] = sc.nextInt();
        } d[i] = sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc Arrays.sort(d) Arrays.sort Arrays d int lastAbcIndex = (N - 1)/2; lastAbcIndex (N - 1)/2 (N - 1) N 1 2 int firstArcIndex = (N + 1)/2; firstArcIndex (N + 1)/2 (N + 1) N 1 2 int lastAbc = d[lastAbcIndex]; lastAbc d[lastAbcIndex] d lastAbcIndex int firstArc = d[firstArcIndex]; firstArc d[firstArcIndex] d firstArcIndex int ans; ans if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        } lastAbc == firstArc lastAbc firstArc {
            ans = 0;
        } ans = 0 ans 0 {
            ans = firstArc - lastAbc;
        } ans = firstArc - lastAbc ans firstArc - lastAbc firstArc lastAbc System.out.print(ans) System.out.print System.out System System.out ans // Main
    public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    }

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

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    }

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

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }

        Arrays.sort(d);
        int lastAbcIndex = (N - 1)/2;
        int firstArcIndex = (N + 1)/2;
        int lastAbc = d[lastAbcIndex];
        int firstArc = d[firstArcIndex];

        int ans;
        if (lastAbc == firstArc) {
            ans = 0;
        }
        else {
            ans = firstArc - lastAbc;
        }
        System.out.print(ans);
    }

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

