import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter 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) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        } solve {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        } int N = in.nextInt(); N in.nextInt() in.nextInt in int[] d = new int[N]; d new int[N] N for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                d[i] = in.nextInt();
            } {
                d[i] = in.nextInt();
            } d[i] = in.nextInt() d[i] d i in.nextInt() in.nextInt in Arrays.sort(d) Arrays.sort Arrays d int l = d[N / 2 - 1]; l d[N / 2 - 1] d N / 2 - 1 N / 2 N 2 1 int r = d[N / 2]; r d[N / 2] d N / 2 N 2 if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            } l == r l r {
                out.println(0);
            } out.println(0) out.println out 0 {
                out.println(r - l);
            } out.println(r - l) out.println out r - l r l int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = in.nextInt();
            }
            Arrays.sort(d);
            int l = d[N / 2 - 1];
            int r = d[N / 2];
            if (l == r) {
                out.println(0);
            } else {
                out.println(r - l);
            }
        }

    }
}

