#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;


//J题
int a[100001];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	cout << a[n / 2] - a[n / 2 - 1] << endl;
}