import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    }
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream 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) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    }
} Main public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    } main {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    } try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        } {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        } BufferedInputStream in = new BufferedInputStream(System.in) BufferedInputStream in = new BufferedInputStream(System.in) new BufferedInputStream(System.in) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) new PrintWriter(new BufferedOutputStream(System.out)) Scanner sc = new Scanner(in); sc new Scanner(in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] vs = new int[n]; vs new int[n] n for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < vs.length i vs.length vs vs.length i++ i++ i vs[i] = sc.nextInt(); vs[i] = sc.nextInt() vs[i] vs i sc.nextInt() sc.nextInt sc Arrays.sort(vs) Arrays.sort Arrays vs out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]) out.println out vs[vs.length / 2] - vs[vs.length / 2 - 1] vs[vs.length / 2] vs vs.length / 2 vs.length vs vs.length 2 vs[vs.length / 2 - 1] vs vs.length / 2 - 1 vs.length / 2 vs.length vs vs.length 2 1 String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    }
} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    }
} Main
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 11:16-

            int n = sc.nextInt();
            int[] vs = new int[n];

            for (int i = 0; i < vs.length; i++) vs[i] = sc.nextInt();
            Arrays.sort(vs);

            out.println(vs[vs.length / 2] - vs[vs.length / 2 - 1]);
        }
    }
}
