// Slower C++ solution:
#include<bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp>

//#include <ext/pb_ds/tree_policy.hpp>

#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define pb          push_back

#define inf         2e9+5

#define mp          make_pair

#define ll          long long

#define pii         pair<int,int >

#define fileout     freopen("output.txt","w",stdout)

#define filein      freopen("input.txt","r",stdin)

#define mem(x,i)    memset(x,i,sizeof x)

#define PI          acos(-1.0)

#define ff          first

#define ss          second

#define all(x)      x.begin(),x.end()

#define Case(t)     for(int ks=1;ks<=t;ks++)

#define sf          scanf

#define pf          printf

/*------------------------------Graph Moves----------------------------*/

const int fx[]= {+1,-1,+0,+0};

const int fy[]= {+0,+0,+1,-1};

//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move

//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move

//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move

//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

/*---------------------------------------------------------------------*/

using namespace std;

//using namespace __gnu_pbds;

//

//template <typename T>  using orderedSet =

//    tree<T, null_type, less<T>,

//    rb_tree_tag, tree_order_statistics_node_update>;//find_by_order,order_of_key

//

int n;

int arr[100005];

void solve()

{

    cin>>n;

    for(int i=0;i<n;i++)

        cin>>arr[i];

    sort(arr,arr+n);

    int ans=0;

    for(int i=0;i<=arr[n-1] ;i++)

    {

        int x=upper_bound(arr,arr+n,i)-arr;

        if(x==n/2) ans++;

    }

    cout<<ans<<endl;

}



int main()

{

    solve();

}


// Faster C++ solution for the same problem (measured speedup: 1.2609609330007923x):
#include<bits/stdc++.h>

using namespace std;



///******************************** C o n t a i n e r ********************************///



typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

typedef vector<pii> vii;

typedef vector<pll> vll;



///*********************************** C o n s t ***********************************///



const int       N=1e6+123;

const double    PI = acos(-1);

const ll        MOD=1000000007;                 ///1e9+7

ll dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};       ///first 4 for adjacent

ll dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

ll dx8[]= {+1, +1, -1, -1, +2, +2, -2, -2};    ///knights move

ll dy8[]= {+2, -2, +2, -2, +1, -1, +1, -1};



///********************************** M a r c o ***********************************///



#define pb push_back

#define F first

#define S second

#define test int tc; cin>>tc; while(tc--)

#define forn(i,n) for(i=0;i<n;i++)

#define rforn(i,n) for(i=n-1;i>=0;i--)

#define all(a) a.begin(),a.end()

#define rall(a) a.rbegin(),a.rend()

#define sz(x) x.size()

#define el <<'\n'

#define sp <<' '

#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}

#define mem(a,b) memset(a, b, sizeof(a))

#define gcd(a,b) __gcd(a,b)

#define lcm(a,b) (a*(b/gcd(a,b)))

#define sqr(a) (a)*(a)



#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);



///*********************************** F u n c t i o n ***********************************///



ll powmod(ll a,ll b){ a%=MOD;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=MOD;--b;}a*=a;a%=MOD;b/=2;}return pr;}

ll modinverse(ll a){return powmod(a,MOD-2);}

bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}

void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<N;jj+=2*ii)a[jj]=true;}

void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}

void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}



///**************************************************** C o d e ****************************************************///

///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///







void _case()

{

    ll n,i,ans=0;

    cin>>n;

    ll a[n];

    forn(i,n) cin>>a[i];

    sort(a,a+n);

    if(a[n/2]==a[n/2-1]) cout<<0 el;

    else{

        ll x=a[n/2];

        while(x!=a[n/2-1]) x--,ans++;

        cout<<ans el;

    }

}



main()

{

    fastio();

    _case();



}





///Thank you.





///Brainless_Loco Terminates Here!