import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    }
} import java.io.File; File java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    }
} Main public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    } main {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            arr[i] = s.nextInt();
        } {
            arr[i] = s.nextInt();
        } arr[i] = s.nextInt() arr[i] arr i s.nextInt() s.nextInt s Arrays.sort(arr) Arrays.sort Arrays arr int midLow = (n / 2) - 1; midLow (n / 2) - 1 (n / 2) n 2 1 int low = arr[midLow] + 1; low arr[midLow] + 1 arr[midLow] arr midLow 1 int high = arr[midLow + 1]; high arr[midLow + 1] arr midLow + 1 midLow 1 System.out.println(high - low + 1) System.out.println System.out System System.out high - low + 1 high - low high low 1 String[] args args public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    }
} public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    }
} Main
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
        }

        Arrays.sort(arr);

        int midLow = (n / 2) - 1;


        int low = arr[midLow] + 1;
        int high = arr[midLow + 1];

        System.out.println(high - low + 1);
    }
}
