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

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

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

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

    } main {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int nums[] = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = input.nextInt();
        }
        Arrays.sort(nums);
        if(nums[n/2] > nums[n/2-1])
            System.out.println(nums[n/2] - nums[n/2-1]);
        else
            System.out.println(0);

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

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

    }
} Main
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

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

    }
}
