import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	}

} import java.util.*; util.* java import java.io.*; io.* java import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	}

} Main public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) int N = Integer.parseInt(in.readLine()); N Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in List<Integer> scores = new ArrayList<>(N); scores new ArrayList<>(N) String[] tokens = in.readLine().split(" "); tokens in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			scores.add(Integer.parseInt(tokens[i]));
		} {
			scores.add(Integer.parseInt(tokens[i]));
		} scores.add(Integer.parseInt(tokens[i])) scores.add scores Integer.parseInt(tokens[i]) Integer.parseInt Integer tokens[i] tokens i Collections.sort(scores) Collections.sort Collections scores int little = scores.get(scores.size() / 2 - 1); little scores.get(scores.size() / 2 - 1) scores.get scores scores.size() / 2 - 1 scores.size() / 2 scores.size() scores.size scores 2 1 int large = scores.get(scores.size() / 2); large scores.get(scores.size() / 2) scores.get scores scores.size() / 2 scores.size() scores.size scores 2 int result = large - little; result large - little large little System.out.println(result) System.out.println System.out System System.out result in.close() in.close in String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	}

} Main
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		List<Integer> scores = new ArrayList<>(N);
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			scores.add(Integer.parseInt(tokens[i]));
		}
		Collections.sort(scores);
		int little = scores.get(scores.size() / 2 - 1);
		int large = scores.get(scores.size() / 2);
		int result = large - little;
		System.out.println(result);

		in.close();
	}

}
