import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    }
} Main public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    } main {
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int count = 0; count 0 int num[] = new int[n]; num new int[n] n for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            num[i] = stdIn.nextInt();
        } {
            num[i] = stdIn.nextInt();
        } num[i] = stdIn.nextInt() num[i] num i stdIn.nextInt() stdIn.nextInt stdIn Arrays.sort(num) Arrays.sort Arrays num int k = num[n / 2] - num[n / 2 - 1]; k num[n / 2] - num[n / 2 - 1] num[n / 2] num n / 2 n 2 num[n / 2 - 1] num n / 2 - 1 n / 2 n 2 1 System.out.println(k) System.out.println System.out System System.out k String args[] args public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    }
} public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int count = 0;
        int num[] = new int[n];

        for(int i = 0; i < n; i++){
            num[i] = stdIn.nextInt();
        }
        
        Arrays.sort(num);
                
        int k = num[n / 2] - num[n / 2 - 1];
        
        System.out.println(k);
    }
}
