#include<bits/stdc++.h>
#define ll long long int
using namespace std;
 int main()
 {

     int n;
     cin>>n;
     vector<int>v;
     for(int i=0;i<n;i++)
     {
         int x;
         cin>>x;
         v.push_back(x);
     }
     sort(v.begin(),v.end());

         int u=(n/2)-1;
         if(v[u]==v[u+1])
         {
             cout<<"0"<<endl;

         }
         else
         {
             int ans=v[u+1]-v[u];
             cout<<ans<<endl;
         }


 }
