#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 total=0;
    if (start == finish)
    {
        printf("%d",0);
    }
    else
    {
        for (int j=start+1;j<=finish;j++)
        {
            total++;
        }
        printf("%d",total);

    }

    return 0;
}