import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int[]d = new int[n]; d new int[n] n for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			d[i] = stdIn.nextInt();
		} {
			d[i] = stdIn.nextInt();
		} d[i] = stdIn.nextInt() d[i] d i stdIn.nextInt() stdIn.nextInt stdIn Arrays.parallelSort(d) Arrays.parallelSort Arrays d long cnt = 0; cnt 0 for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		} int i = d[n/2-1]+1; int i = d[n/2-1]+1; i d[n/2-1]+1 d[n/2-1] d n/2-1 n/2 n 2 1 1 i <=d[n/2] i d[n/2] d n/2 n 2 i++ i++ i {
			cnt++;
		} {
			cnt++;
		} cnt++ cnt 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) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	}

} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int[]d = new int[n];
		for(int i = 0; i < n; i++) {
			d[i] = stdIn.nextInt();
		}
		
		Arrays.parallelSort(d);
		long cnt = 0;
		
		for(int i = d[n/2-1]+1; i <=d[n/2];i++) {
			cnt++;
		}
		
		System.out.println(cnt);
		
	}

}
