import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int result = 0; result 0 int max = 0 max 0 min = 1000000; min 1000000 int arc = 0; arc 0 int abc = 0; abc 0 String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int list[] = new int[n]; list new int[n] n for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		} {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		} list[i] = Integer.parseInt(str[i]) list[i] list i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i max = Math.max(list[i], max) max Math.max(list[i], max) Math.max Math list[i] list i max min = Math.min(list[i], min) min Math.min(list[i], min) Math.min Math list[i] list i min Arrays.sort(list) Arrays.sort Arrays list int ave = list[list.length / 2 - 1]; ave list[list.length / 2 - 1] list list.length / 2 - 1 list.length / 2 list.length list list.length 2 1 for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		} int i = ave; int i = ave; i ave i < list[list.length / 2] i list[list.length / 2] list list.length / 2 list.length list list.length 2 i++ i++ i {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		} {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		} result++ result System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	}
} public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int result = 0;
		int max = 0, min = 1000000;
		int arc = 0;
		int abc = 0;

		String str[] = br.readLine().split(" ");
		int list[] = new int[n];

		for (int i = 0; i < n; i++) {
			list[i] = Integer.parseInt(str[i]);
			max = Math.max(list[i], max);
			min = Math.min(list[i], min);
		}

		Arrays.sort(list);
		int ave = list[list.length / 2 - 1];

		for (int i = ave; i < list[list.length / 2]; i++) {
			/*
			 * for (int j = 0; j < n; j++) { if (i >= list[j]) { arc++; } else
			 * if (i < list[j]) { abc++; } } if (abc == arc) result++; abc = 0;
			 * arc = 0;
			 */
			result++;
		}

		System.out.println(result);
	}
}