#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<stack>
#include<queue>
#include<vector>
using namespace std;
int main()
{
	long long int a, b, c, d, i, j, k, m, l, t;
	vector<long long int>v;
	cin >> a;
	for (i = 0; i < a; i++)
	{
		cin >> b;
		v.push_back(b);
	}
	sort(v.begin(), v.end());
	cout << v[a / 2] - v[a / 2 - 1] << endl;
	return 0;
}