import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





}
} import java.io.BufferedReader; BufferedReader java.io import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





}
} Main public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





} main {
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final List<Integer> list = new ArrayList<>(); list new ArrayList<>() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc 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 Collections.sort(list) Collections.sort Collections list int num = list.get(n/2) - list.get(n/2 - 1); num list.get(n/2) - list.get(n/2 - 1) list.get(n/2) list.get list n/2 n 2 list.get(n/2 - 1) list.get list n/2 - 1 n/2 n 2 1 System.out.println(num) System.out.println System.out System System.out num final String[] args args public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





}
} public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





}
} Main
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    int n = sc.nextInt();

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    Collections.sort(list);

    int num = list.get(n/2) - list.get(n/2 - 1);

    //System.out.println(list);

    System.out.println(num);









    
    






    

    



    
  

    


    


    

    
    
    



    





}
}