import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<Integer> d = new ArrayList<>(); d new ArrayList<>() for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            d.add(sc.nextInt());
        } {
            d.add(sc.nextInt());
        } d.add(sc.nextInt()) d.add d sc.nextInt() sc.nextInt sc sc.close() sc.close sc Collections.sort(d) Collections.sort Collections d if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        } d.size() % 2 != 0 d.size() % 2 d.size() d.size d 2 0 {
            System.out.println(0);
            System.exit(0);
        } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 int a = d.get(n / 2 - 1); a d.get(n / 2 - 1) d.get d n / 2 - 1 n / 2 n 2 1 int b = d.get(n / 2); b d.get(n / 2) d.get d n / 2 n 2 int ans = b - a; ans b - a b a System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> d = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            d.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(d);

        if (d.size() % 2 != 0) {
            System.out.println(0);
            System.exit(0);
        }

        int a = d.get(n / 2 - 1);
        int b = d.get(n / 2);
        int ans = b - a;
        System.out.println(ans);
    }

}
