import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    static Scanner sc=new Scanner(in);
    public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    }
} import java.util.*; util.* java import java.io.*; io.* java import java.awt.*; awt.* java import java.awt.geom.*; geom.* java.awt import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
    static Scanner sc=new Scanner(in);
    public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    }
} Main static Scanner sc=new Scanner(in); sc new Scanner(in) public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    } main {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    } int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] d=new int[n]; d new int[n] n int ans=0; ans 0 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 ans=max(0,d[n/2]-d[n/2-1]) ans max(0,d[n/2]-d[n/2-1]) max 0 d[n/2]-d[n/2-1] d[n/2] d n/2 n 2 d[n/2-1] d n/2-1 n/2 n 2 1 out.println(ans) out.println out ans String[] args args public class Main {
    static Scanner sc=new Scanner(in);
    public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    }
} public class Main {
    static Scanner sc=new Scanner(in);
    public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    }
} Main
import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    static Scanner sc=new Scanner(in);
    public static void main(String[] args) {
        int n=sc.nextInt();
        int[] d=new int[n];
        int ans=0;
        for (int i = 0; i < n; i++) {
            d[i]=sc.nextInt();
        }
        Arrays.sort(d);
        ans=max(0,d[n/2]-d[n/2-1]);
        out.println(ans);
    }
}