#include<bits/stdc++.h>
using namespace std;

/// MOD-MAX-INF
#define MOD          (int)1e9+7
#define MAX          (int)1e4+5
#define INF          INFINITY

/// VAR SHORTCUT
#define ll           long long
#define ull          unsigned long long
#define pll          pair<ll,ll>
#define pii          pair<int,int>

/// SCAN-PRINT-LOOP SHORTCUTS
#define sfl(a)       scanf("%I64d",&a)
#define sf(a)        scanf("%d",&a)
#define sf2(a,b)     scanf("d",&a,&b)
#define sf3(a,b,c)   scanf("d%d",&a,&b,&c)
#define pfl(a)       printf("%I64d\n",a)
#define pf(a)        printf("%d\n",a)
#define forr(a,b)    for(int i=a;i<=b;i++)
#define rforr(a,b)   for(int i=b;i>=a;i--)

/// BUG-CAS-FILE SHORTCUTS
#define bug(a)       cerr << #a << " : " << a << endl;
#define pfC(cas)     cout << "Case " << cas << ": "
#define pfCn(cas)    cout << "Case " << cas << ":\n"
#define IN           freopen("input.txt","r",stdin);
#define OUT          freopen("output.txt","w",stdout);

/// STL SHORTCUT
#define mem(a,b)     memset(a,b,sizeof(a))
#define all(x)       x.begin(),x.end()
#define rall(x)      x.rbegin(),x.rend()
#define pb           push_back
#define F            first
#define S            second

/// Others
#define lcm(a,b)     ((a/__gcd(a,b))*b)
#define Time()       cout<< "\nElapsed Time : " << (clock()*1.0) / CLOCKS_PER_SEC <<" sec"<< endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);
int main()
{
    int n;
    cin>>n;
    vector<int>v;
    forr(1,n)
    {
        int x;
        cin>>x;
        v.push_back(x);
    }
    sort(v.begin(),v.end());
    cout<<v[n/2]-v[(n/2)-1]<<endl;
}
