import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	} main {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc final int nHalf = n / 2; nHalf n / 2 n 2 List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list.add(sc.nextInt());
		} {
			list.add(sc.nextInt());
		} list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc Collections.sort(list) Collections.sort Collections list final int numHalf = list.get(nHalf - 1); numHalf list.get(nHalf - 1) list.get list nHalf - 1 nHalf 1 final int numHalfNext = list.get(nHalf); numHalfNext list.get(nHalf) list.get list nHalf if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		} numHalf == numHalfNext numHalf numHalfNext {
			System.out.print(0);
			return;
		} System.out.print(0) System.out.print System.out System System.out 0 return; System.out.print(numHalfNext - numHalf) System.out.print System.out System System.out numHalfNext - numHalf numHalfNext numHalf String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int nHalf = n / 2;

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			list.add(sc.nextInt());
		}

		Collections.sort(list);

		final int numHalf = list.get(nHalf - 1);
		final int numHalfNext = list.get(nHalf);

		if (numHalf == numHalfNext) {
			System.out.print(0);
			return;
		}

		System.out.print(numHalfNext - numHalf);

	}

}