#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
//J题
int a[100001];
int main()
{
	int n;
	cin >> n;
	cout << endl;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	cout << a[n / 2] - a[(n / 2 )- 1];
}
