import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

public class Main {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

        System.out.println(b-a);
    }
} import java.util.AbstractMap; AbstractMap java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.AbstractMap.SimpleEntry; SimpleEntry java.util.AbstractMap public class Main {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

        System.out.println(b-a);
    }
} Main static final int modnum = 1000000000 + 7; modnum 1000000000 + 7 1000000000 7 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

        System.out.println(b-a);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/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 ArrayList<Integer> list = new ArrayList<Integer>(N); list new ArrayList<Integer>(N) 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 list.sort(Comparator.naturalOrder()) list.sort list Comparator.naturalOrder() Comparator.naturalOrder Comparator int a = list.get(N/2-1); a list.get(N/2-1) list.get list N/2-1 N/2 N 2 1 int b = list.get(N/2); b list.get(N/2) list.get list N/2 N 2 System.out.println(b-a) System.out.println System.out System System.out b-a b a String[] args args public class Main {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

        System.out.println(b-a);
    }
} public class Main {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

        System.out.println(b-a);
    }
} Main
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

public class Main {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<Integer>(N);
        for(int i=0;i<N;i++){
            list.add(sc.nextInt());
        }
        list.sort(Comparator.naturalOrder());

        int a = list.get(N/2-1);
        int b = list.get(N/2);

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