import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    }
} import java.util.*; util.* java public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    }
} Main public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc final 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 final int size = d.length; size d.length d d.length Arrays.sort(d) Arrays.sort Arrays d int a = d[size/2 - 1]; a d[size/2 - 1] d size/2 - 1 size/2 size 2 1 int b = d[size/2]; b d[size/2] d size/2 size 2 System.out.println(b-a) System.out.println System.out System System.out b-a b a sc.close() sc.close sc String[] args args public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    }
} public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    }
} Main
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final int []d = new int[n];
        for (int i = 0;i<n;++i) d[i] = sc.nextInt();
        final int size = d.length;
        Arrays.sort(d);
        int a = d[size/2 - 1];
        int b = d[size/2];

        System.out.println(b-a);
        sc.close();
    }
}