#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    int a[10000];
    scanf("%d",&n);
    for (int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }


    sort(a,a+n);
    int start = a[n/2-1];
    int finish =a[(n/2)];
    int k;
    k=finish - start;
    printf("%d",k);

    return 0;
}
