import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    } main {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            list.add(sc.nextInt());
        } {
            list.add(sc.nextInt());
        } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc sc.close() sc.close sc Collections.sort(list) Collections.sort Collections list int a = N/2 - 1; a N/2 - 1 N/2 N 2 1 int b = N/2; b N/2 N 2 int t = list.get(a); t list.get(a) list.get list a int y = list.get(b); y list.get(b) list.get list b if (t == y){
            System.out.println("0");
            return;
        } t == y t y {
            System.out.println("0");
            return;
        } System.out.println("0") System.out.println System.out System System.out "0" return; int count = y - t; count y - t y t System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i=0; i<N; i++){
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        int a = N/2 - 1;
        int b = N/2;

        int t = list.get(a);
        int y = list.get(b);

        if (t == y){
            System.out.println("0");
            return;
        }

        int count = y - t;
        System.out.println(count);
    }
}