import java.util.*;

public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    int N;
//    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    }

} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    int N;
//    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    }

} Main int N; N public static void main(String[] args){
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args //    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    } run {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner List<Integer> d = new ArrayList<>(); d new ArrayList<>() for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            d.add(i, scanner.nextInt());
        } {
            d.add(i, scanner.nextInt());
        } d.add(i, scanner.nextInt()) d.add d i scanner.nextInt() scanner.nextInt scanner if(N % 2 == 1) {
            System.out.println(0);
            return;
        } N % 2 == 1 N % 2 N 2 1 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; d.sort(Comparator.naturalOrder()) d.sort d Comparator.naturalOrder() Comparator.naturalOrder Comparator int index = N / 2; index N / 2 N 2 int a = d.get(index); a d.get(index) d.get d index int b = d.get(index-1); b d.get(index-1) d.get d index-1 index 1 System.out.println(a-b) System.out.println System.out System System.out a-b a b public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    int N;
//    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    }

} public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    int N;
//    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    }

} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    int N;
//    int[] d;
    private void run() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        List<Integer> d = new ArrayList<>();
        for(int i = 0; i < N; i++) {
            d.add(i, scanner.nextInt());
        }
        if(N % 2 == 1) {
            System.out.println(0);
            return;
        }
        // sort
        d.sort(Comparator.naturalOrder());
        int index = N / 2;
        int a = d.get(index);
        int b = d.get(index-1);

        System.out.println(a-b);
    }

}