import java.util.*;
import java.util.Scanner;


public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    }
} import java.util.*; util.* java import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[] = new int[n]; a new int[n] n int res = 0; res 0 for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc Arrays.sort(a) Arrays.sort Arrays a if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        } a[n/2-1] != a[n/2] a[n/2-1] a n/2-1 n/2 n 2 1 a[n/2] a n/2 n 2 {
            res = a[n/2]-a[n/2-1];
        } res = a[n/2]-a[n/2-1] res a[n/2]-a[n/2-1] a[n/2] a n/2 n 2 a[n/2-1] a n/2-1 n/2 n 2 1 System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    }
} Main
import java.util.*;
import java.util.Scanner;


public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a[] = new int[n];
        int res = 0;
        
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }
        
        Arrays.sort(a);
        
        if(a[n/2-1] != a[n/2]){
            res = a[n/2]-a[n/2-1];
        }
        
        System.out.println(res);
    }
}
