import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] p = new int[n]; p new int[n] n for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        } int  i=0; int  i=0; i 0 i<n i n i++ i++ i {
            p[i] = sc.nextInt();
        } {
            p[i] = sc.nextInt();
        } p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc Arrays.sort(p) Arrays.sort Arrays p int half = p.length / 2; half p.length / 2 p.length p p.length 2 if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        } p[half - 1] == p[half] p[half - 1] p half - 1 half 1 p[half] p half {
            System.out.println("0");
        } System.out.println("0") System.out.println System.out System System.out "0" {
            System.out.println(p[half] - p[half -1]);
        } System.out.println(p[half] - p[half -1]) System.out.println System.out System System.out p[half] - p[half -1] p[half] p half p[half -1] p half -1 half 1 String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int  i=0;i<n;i++) {
            p[i] = sc.nextInt();
        }
        Arrays.sort(p);
        int half = p.length / 2;
        if (p[half - 1] == p[half]) {
            System.out.println("0");
        } else {
            System.out.println(p[half] - p[half -1]);
        }
    }
}