#include<bits/stdc++.h>
#define mx 100001
#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)
#define fm cout<<"Case "<<raf<<": "
using namespace std;
int main()
{
    int b,c,d,e,f,i,j,n;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)cin>>a[i];
    sort(a, a+n);
    cout<<(a[n/2]-a[n/2-1])<<endl;













    return 0;
}
