#include<bits/stdc++.h>
#define     sc(a)       scanf("%d",&a)
#define     sc2(a,b)    scanf("%d%d",&a,&b)
#define     line        "\n"
#define     space       " "
#define     MAX         100010
#define     MOD         1000000007
#define     Q           int nn ; scanf("%d",&nn); for (int xx=0;xx<nn;xx++)
#define     ff          first
#define     ss          second
#define     pf(a)       printf("%d\n",a)
#define     pfs(a)      printf("%d ",a)
#define     pf2(a,b)    printf("%d %d\n",a,b)
#define     itm(it)     map<int,int>:: iterator it
#define     its(it)     set<int>:: iterator it
#define     ac_sort(v)  sort(v.begin(),v.end())
#define     dc_sort(v)  sort(v.rbegin(),v.rend())
typedef long long lld;
using namespace std;
int main()
{
    int n ; sc(n);
    int k = n/2;
    int arr[n];
    for (int x=0;x<n;x++) sc(arr[x]);
    sort(arr,arr+n);
    int a = arr[k-1],b=arr[k];
    int c = b-a;
    pf(c);
}
