import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    }

    public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    }

    public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    } main {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String num = sc.nextLine(); num sc.nextLine() sc.nextLine sc String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc check(num, line) check num line String[] args args public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    } check {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    } int cnt = Integer.parseInt(num); cnt Integer.parseInt(num) Integer.parseInt Integer num String[] strs = line.split(" "); strs line.split(" ") line.split line " " int[] nums = new int[strs.length]; nums new int[strs.length] strs.length strs strs.length for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        } int i=0; int i=0; i 0 i<strs.length i strs.length strs strs.length i++ i++ i {
            nums[i] = Integer.parseInt(strs[i]);
        } {
            nums[i] = Integer.parseInt(strs[i]);
        } nums[i] = Integer.parseInt(strs[i]) nums[i] nums i Integer.parseInt(strs[i]) Integer.parseInt Integer strs[i] strs i Arrays.sort(nums) Arrays.sort Arrays nums int size = cnt/2; size cnt/2 cnt 2 if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        } nums[size-1]==nums[size] nums[size-1] nums size-1 size 1 nums[size] nums size {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; System.out.println(nums[size]-nums[size-1]) System.out.println System.out System System.out nums[size]-nums[size-1] nums[size] nums size nums[size-1] nums size-1 size 1 String num num String line line public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    }

    public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    }

    public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    }
} Main
import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String line = sc.nextLine();
        check(num, line);
    }

    public static void check(String num, String line) {
        int cnt = Integer.parseInt(num);
        String[] strs = line.split(" ");
        int[] nums = new int[strs.length];
        for(int i=0; i<strs.length; i++) {
            nums[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(nums);
        int size = cnt/2;
        if(nums[size-1]==nums[size]) {
            System.out.println(0);
            return;
        }
        System.out.println(nums[size]-nums[size-1]);
    }
}