import java.io.InputStream;
import java.io.PrintStream;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    //static int d[] = new int[MAX];
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.lang.reflect.Array; Array java.lang.reflect import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    //static int d[] = new int[MAX];
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} Main static final int MAX = 100100; MAX 100100 InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    } _main {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    } Scanner sc = new Scanner(in); sc new Scanner(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] d i sc.nextInt() sc.nextInt sc Arrays.sort(d) Arrays.sort Arrays d if ((N&1)==1) {out.println("0"); return;} (N&1)==1 (N&1) N 1 1 {out.println("0"); return;} out.println("0") out.println out "0" return; int mid = N/2; mid N/2 N 2 out.println(d[mid] - d[mid-1]) out.println out d[mid] - d[mid-1] d[mid] d mid d[mid-1] d mid-1 mid 1 String[] args args public static void main(String[] args) {
        new Main()._main(args);
    } main {
        new Main()._main(args);
    } new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    //static int d[] = new int[MAX];
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    //static int d[] = new int[MAX];
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    //static int d[] = new int[MAX];
    // static int dp[][] = new int[MAX][MAX];

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int d[] = new int[N];
        for (int i=0;i<N;i++) d[i] = sc.nextInt();

        Arrays.sort(d);
        if ((N&1)==1) {out.println("0"); return;}
        int mid = N/2;
        out.println(d[mid] - d[mid-1]);
    }

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