import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    } main {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc String[] line2 = line1.split(" "); line2 line1.split(" ") line1.split line1 " " int[] ary = new int[n]; ary new int[n] n for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]); int i = 0; int i = 0; i 0 i < n i n i++ i++ i ary[i] = Integer.parseInt(line2[i]); ary[i] = Integer.parseInt(line2[i]) ary[i] ary i Integer.parseInt(line2[i]) Integer.parseInt Integer line2[i] line2 i Arrays.sort(ary) Arrays.sort Arrays ary if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]); ary[ary.length / 2] == ary[ary.length / 2 - 1] ary[ary.length / 2] ary ary.length / 2 ary.length ary ary.length 2 ary[ary.length / 2 - 1] ary ary.length / 2 - 1 ary.length / 2 ary.length ary ary.length 2 1 System.out.println(0) System.out.println System.out System System.out 0 System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]) System.out.println System.out System System.out ary[ary.length / 2] - ary[ary.length / 2 - 1] ary[ary.length / 2] ary ary.length / 2 ary.length ary ary.length 2 ary[ary.length / 2 - 1] ary ary.length / 2 - 1 ary.length / 2 ary.length ary ary.length 2 1 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        Arrays.sort(ary);
        if(ary[ary.length / 2] == ary[ary.length / 2 - 1])
        System.out.println(0);
        else
        System.out.println(ary[ary.length / 2] - ary[ary.length / 2 - 1]);
    }
}