import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] arr = new int[n]; arr new int[n] n for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i arr[i] = sc.nextInt(); arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc Arrays.sort(arr) Arrays.sort Arrays arr int lowerBound = arr[n/2-1] + 1; lowerBound arr[n/2-1] + 1 arr[n/2-1] arr n/2-1 n/2 n 2 1 1 int upperBound = arr[n/2]; upperBound arr[n/2] arr n/2 n 2 int cnt = 0; cnt 0 while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        } lowerBound <= upperBound lowerBound upperBound {
        	cnt++;
        	lowerBound++;
        } cnt++ cnt lowerBound++ lowerBound System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++)
        	arr[i] = sc.nextInt();
        Arrays.sort(arr);
        int lowerBound = arr[n/2-1] + 1;
        int upperBound = arr[n/2];
        int cnt = 0;
        while(lowerBound <= upperBound) {
        	cnt++;
        	lowerBound++;
        }
        System.out.println(cnt);
    }
}
