import java.util.*;

public class Main {

    public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    } main {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    } int count = 0; count 0 boolean sw = false; sw false int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE double dMax = Double.MIN_VALUE; dMax Double.MIN_VALUE Double Double.MIN_VALUE double dMin = Double.MAX_VALUE; dMin Double.MAX_VALUE Double Double.MAX_VALUE int answer = 0; answer 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int d[]=new int[n]; d new int[n] n for (int i=0;i<n;++i) { d[i]=sc.nextInt(); } int i=0; int i=0; i 0 i<n i n ++i ++i i { d[i]=sc.nextInt(); } { d[i]=sc.nextInt(); } d[i]=sc.nextInt() d[i] d i sc.nextInt() sc.nextInt sc Arrays.sort(d) Arrays.sort Arrays d int k1=d[n/2-1]; k1 d[n/2-1] d n/2-1 n/2 n 2 1 int k2=d[n/2]; k2 d[n/2] d n/2 n 2 answer=k2-k1 answer k2-k1 k2 k1 if (answer<=0) {answer=0;} answer<=0 answer 0 {answer=0;} answer=0 answer 0 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

    public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
} public class Main {

    public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        //
        //Compute c1=new Compute();//計算系
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        int answer = 0;
        //String answer="No";
        //StringBuilder answer=new StringBuilder();
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //入力
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int d[]=new int[n];
        for (int i=0;i<n;++i) { d[i]=sc.nextInt(); }
        Arrays.sort(d);

        int k1=d[n/2-1];
        int k2=d[n/2];

        answer=k2-k1;
        if (answer<=0) {answer=0;}

        //出力
        //BigDecimal bd = new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
}