import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] array = new int[n]; array new int[n] n for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = sc.nextInt();
        } {
            array[i] = sc.nextInt();
        } array[i] = sc.nextInt() array[i] array i sc.nextInt() sc.nextInt sc int count = 0; count 0 Arrays.sort(array) Arrays.sort Arrays array int a = array[n / 2 - 1]; a array[n / 2 - 1] array n / 2 - 1 n / 2 n 2 1 int b = array[n / 2]; b array[n / 2] array n / 2 n 2 if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        } a == b a b {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(b - a);
        } 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) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        int count = 0;
        Arrays.sort(array);
        int a = array[n / 2 - 1];
        int b = array[n / 2];
        
        if (a == b) {
            System.out.println(0);
        } else {
            System.out.println(b - a);
        }
    }
} Main
import java.util.*;

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