import java.util.*;
import java.util.stream.Collector;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    }

}
 import java.util.*; util.* java import java.util.stream.Collector; Collector java.util.stream public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    }

} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

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

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    }

} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    }

} Main
import java.util.*;
import java.util.stream.Collector;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for(int i = 0;i < n;i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int a = list.get(list.size()/2-1);
        int b = list.get(list.size()/2);
        System.out.println(b - a);
    }

}

