import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    } main {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int total = Integer.parseInt(sc.next()); total Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        } int x =1; int x =1; x 1 x <= total x total x++ x++ x {
            list.add(Integer.parseInt(sc.next()));
        } {
            list.add(Integer.parseInt(sc.next()));
        } list.add(Integer.parseInt(sc.next())) list.add list Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list int x = list.get(total/2-1); x list.get(total/2-1) list.get list total/2-1 total/2 total 2 1 int y = list.get(total/2); y list.get(total/2) list.get list total/2 total 2 System.out.println(y-x) System.out.println System.out System System.out y-x y x String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int total = Integer.parseInt(sc.next());
        List<Integer> list = new ArrayList<>();
        for (int x =1; x <= total ; x++) {
            list.add(Integer.parseInt(sc.next()));
        }
        Collections.sort(list);
        int x = list.get(total/2-1);
        int y = list.get(total/2);
        System.out.println(y-x);
    }
}
