import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int array[] = null;
		int temp = 0;

		Scanner scanner = new Scanner(System.in);

		//入力値を扱いやすいように配列化
		for(int i = 0; scanner.hasNext(); i++) {

			//最初の入力で配列作成
			if(i == 0) {

				temp = Integer.parseInt(scanner.next());

				array = new int[temp];

			}
			
			array[i] = Integer.parseInt(scanner.next());
			
		}

		//照準ソート
		Arrays.sort(array);

		//間の値の差を求める
		System.out.println((array[(temp / 2)] - array[((temp / 2) -1)]));
		
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz