import java.util.*;

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


    }

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


    }

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


    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        ArrayList<Integer> v = new ArrayList<>();
        for (int i=0;i<n;i++){
            v.add(scanner.nextInt());
        }
        Collections.sort(v);
        int a = v.get(n/2 - 1);
        int b = v.get(n/2);
        System.out.println(b-a);


    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner ArrayList<Integer> v = new ArrayList<>(); v new ArrayList<>() for (int i=0;i<n;i++){
            v.add(scanner.nextInt());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            v.add(scanner.nextInt());
        } {
            v.add(scanner.nextInt());
        } v.add(scanner.nextInt()) v.add v scanner.nextInt() scanner.nextInt scanner Collections.sort(v) Collections.sort Collections v int a = v.get(n/2 - 1); a v.get(n/2 - 1) v.get v n/2 - 1 n/2 n 2 1 int b = v.get(n/2); b v.get(n/2) v.get v 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 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        ArrayList<Integer> v = new ArrayList<>();
        for (int i=0;i<n;i++){
            v.add(scanner.nextInt());
        }
        Collections.sort(v);
        int a = v.get(n/2 - 1);
        int b = v.get(n/2);
        System.out.println(b-a);


    }

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


    }

} Main
import java.util.*;

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


    }

}