import java.util.*;

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

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