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> dList = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            int d = sc.nextInt();
            dList.add(d);
        }
        Collections.sort(dList);
        sc.close();

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    }
} 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> dList = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            int d = sc.nextInt();
            dList.add(d);
        }
        Collections.sort(dList);
        sc.close();

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

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

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<Integer> dList = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            int d = sc.nextInt();
            dList.add(d);
        }
        Collections.sort(dList);
        sc.close();

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc List<Integer> dList = new ArrayList<Integer>(); dList new ArrayList<Integer>() for (int i = 0; i < N; i++) {
            int d = sc.nextInt();
            dList.add(d);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int d = sc.nextInt();
            dList.add(d);
        } {
            int d = sc.nextInt();
            dList.add(d);
        } int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc dList.add(d) dList.add dList d Collections.sort(dList) Collections.sort Collections dList sc.close() sc.close sc int count = dList.get(N / 2) - dList.get(N / 2 - 1); count dList.get(N / 2) - dList.get(N / 2 - 1) dList.get(N / 2) dList.get dList N / 2 N 2 dList.get(N / 2 - 1) dList.get dList N / 2 - 1 N / 2 N 2 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

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

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    }
} public class Main {

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

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    }
} 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> dList = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            int d = sc.nextInt();
            dList.add(d);
        }
        Collections.sort(dList);
        sc.close();

        int count = dList.get(N / 2) - dList.get(N / 2 - 1);
        System.out.println(count);

    }
}