import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    }

}
/*


 */ import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    }

} Main public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(in.readLine()); n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in int[] arr = new int[n]; arr new int[n] n StringTokenizer st = new StringTokenizer(in.readLine()); st new StringTokenizer(in.readLine()) for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            arr[i] = Integer.parseInt(st.nextToken());
        } {
            arr[i] = Integer.parseInt(st.nextToken());
        } arr[i] = Integer.parseInt(st.nextToken()) arr[i] arr i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st Arrays.sort(arr) Arrays.sort Arrays arr if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        } arr[n/2] == arr[n/2-1] arr[n/2] arr n/2 n 2 arr[n/2-1] arr n/2-1 n/2 n 2 1 {
            System.out.println("0");
        } System.out.println("0") System.out.println System.out System System.out "0" {
            System.out.println(arr[n/2] - arr[n/2-1]);
        } System.out.println(arr[n/2] - arr[n/2-1]) System.out.println System.out System System.out arr[n/2] - arr[n/2-1] arr[n/2] arr n/2 n 2 arr[n/2-1] arr n/2-1 n/2 n 2 1 String[] args args public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    }

} public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    }

} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int[] arr = new int[n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(arr);
        if (arr[n/2] == arr[n/2-1]) {
            System.out.println("0");
        } else {
            System.out.println(arr[n/2] - arr[n/2-1]);
        }
    }

}
/*


 */