stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <math.h>

using namespace std;



int main()

{

    int a,c,w;

    c=0;

    w=0;

    cin >> a;

    if(a>=111 && a<=999)

    {





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

        {



            if(a%10==9)

                w=1;



            if(a%10==1)

                w=9;



            c=c+w*pow(10,i);

            a=a/10;

        }

        cout << c;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.332598582034461x):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

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

using namespace std;

int main()

{

    string s;

    while(cin>>s)

    {

        string ss="";

        for(int i=0;i<s.size();i++)

        {

            if(s[i]=='9')

            {

               ss+="1";

            }

            else

            {

                ss+="9";

            }



        }

        cout<<ss<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.358684491723228x):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

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



using namespace std;



int main(void)

{

	ios::sync_with_stdio(false);

	cin.tie(nullptr);

	cout.tie(nullptr);



	int n;

	cin >> n;



	cout << 1110 - n << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.406017001259574x):
#include <cstdio>



char str[100010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		printf("%c", '1' + '9' - str[i]);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<string>

using namespace std;

int m, n, a[10], a_2[10], ID[100001];

int dp[100001][10];

int table[] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9};



int rec( int now, int sum ){

  if(now == n + 1) return sum % 10 == 0;

  if(~dp[now][sum % 10]) return dp[now][sum % 10];



  int ret = 0;

  if(~ID[now]){

    ret += rec( now + 1, sum + ID[now]);

  }else{

    if(now & 1)

      for(int i = 0 ; i < m ; i++ ){

        ret += rec( now + 1, sum + a[i]);

      }

    else

      for(int i = 0 ; i < m ; i++ ){

        ret += rec( now + 1, sum + a_2[i]);

      }

  }

  return dp[now][sum % 10] = ret;

}



int main(){

  fill_n( *dp, 100001 * 10, -1);

  cin >> n;

  for(int i = n ; i ; i-- ){

    char c;

    cin >> c;

    if(c == '*') ID[i] = -1;

    else ID[i] = i % 2 ? c - '0' : table[c - '0'];

  }

  cin >> m;

  for(int i = 0 ; i < m ; i++ ){

    cin >> a[i];

    a_2[i] = table[a[i]];

  }

  cout << rec( 1, 0) << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.08410968772763x):
#include<iostream>

#include<algorithm>

#include<string>

using namespace std;

int m, n, a[10], a_2[10], ID[100001];

int table[] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9};



int main(){

  cin >> n;

  for(int i = n ; i ; i-- ){

    char c;

    cin >> c;

    if(c == '*') ID[i] = -1;

    else ID[i] = i % 2 ? c - '0' : table[c - '0'];

  }

  cin >> m;

  for(int i = 0 ; i < m ; i++ ){

    cin >> a[i];

    a_2[i] = table[a[i]];

  }



  int dp[2][10] = {{}};

  dp[0][0] = 1;

  for(int i = 1 ; i < n + 1 ; i++ ){ // 桁

    for(int j = 0 ; j < 10 ; j++ ){

      dp[i & 1][j] = 0;

    }

    if(~ID[i]) {

      for(int j = 0 ; j < 10 ; j++ ){

        dp[i & 1][( j + ID[i] ) % 10] += dp[(i - 1) & 1][j];

      }

    } else {

      for(int k = 0 ; k < m ; k++ ){

        int next = (i % 2 ? a[k] : a_2[k]);

        for(int j = 0 ; j < 10 ; j++ ){

          dp[i & 1][( j + next ) % 10] += dp[(i - 1) & 1][j];

        }

      }

    }

  }

  cout << dp[n & 1][0] << endl;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;



int n;

vector<int> vec;



int main(int argc, char *argv[])

{

    cin >> n;

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

    {

        int num;

        cin >> num;

        vec.emplace_back(num);

    }

    sort(vec.begin(), vec.end());

    ++n;

    cout << vec[n / 2] - vec[n / 2 - 1] << endl;

}

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

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

while(~scanf("%d",&n))

  {

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

    scanf("%d",&d[i]);

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<vector>



using namespace std;



int main()

{

    int n;

    cin>>n;

    int A[1000000];

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

        cin>>A[i];

    sort(A,A+n);

    if(A[n/2] == A[n/2-1])

    {

        cout<<0;

        return 0;

    }

    else

    {

        cout<<A[n/2] - A[n/2-1];

        return 0;

    }

    return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

while(~scanf("%d",&n))

  {

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

    scanf("%d",&d[i]);

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

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

using namespace std;

int n;

int qus[1000005];

int beg,las,midd;

int big,sma;

int fro,tai,ans;

bool ups(int x,int y){

	return x<y;

}

int main(){

	cin>>n;

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

		cin>>qus[i];

	}

	sort(qus,qus+n,ups);

	if(qus[n/2]==qus[n/2-1]){

		cout<<"0"<<endl;

	}

	else cout<<qus[n/2]-qus[n/2-1];

}

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

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

while(~scanf("%d",&n))

  {

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

    scanf("%d",&d[i]);

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

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

using namespace std;



int main() {

	int n;

	cin >> n;

	vector<int> a(n);

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

	{

		cin >> a[i];

	}

	sort(a.begin(), a.end());

	cout << a[n / 2] - a[n / 2 - 1];

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

while(~scanf("%d",&n))

  {

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

    scanf("%d",&d[i]);

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<cstdio>

#include<stdlib.h>

using namespace std; 

int a[100000];

int cmp(const void *a,const void *b)

{

	return *(int *)a - *(int *)b;

}

int main(void)

{

	int n;

	scanf("%d",&n);

	int i;

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

		scanf("%d",&a[i]);

	//sort(a,a+n);

	qsort(a,n,sizeof(a[0]),cmp);

	printf("%d",a[n/2] - a[n/2-1]);

	return 0;	

}

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

#include<algorithm>

using namespace std;

int main()

{int n,d[100000],i,j;

while(~scanf("%d",&n))

  {

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

    scanf("%d",&d[i]);

    sort(d,d+n);

    printf("%d\n",d[n/2]-d[n/2-1]);}

  

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<vector>



using namespace std;



int main()

{

    int n;

    cin>>n;

    int A[1000000];

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

        cin>>A[i];

    sort(A,A+n);

    if(A[n/2] == A[n/2-1])

    {

        cout<<0;

        return 0;

    }

    else

    {

        cout<<A[n/2] - A[n/2-1];

        return 0;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.104758601039393x):
///*****************************************************///

///*.......................Faiyaj Bin Amin............................*///

///*...................................................................*///

///*.........................KUET CSE 2K17......................*///

///*...................................................*///

///*****************************************************///





#include<bits/stdc++.h>



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

#define sf(n) scanf("%d", &n);

#define sff(n, m) scanf("%d %d", &n, &m);

#define pf(n) printf("%d", n);

#define ret return

#define rep(q, i, n) for(int q=i; q<n; q++)  /// type rep(t, 1, n+1) when t is to be iterated from 1 to n

#define rrep(q, i, n) for(int q=i; q>n; q--)

#define mems(a,x) memset(a,x,sizeof(a))

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

#define ll long long

#define ull unsigned long long

#define pb push_back

#define mp make_pair

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

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

#define ff first

#define ss second

#define pii pair<int,int>

#define pdd pair<double, double>

#define pll pair<ll,ll>



#define watch(x) cout << (#x) << " is " << (x) << endl



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

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



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

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



#define PI 2*acos(0.0)



#define mx 100005

#define MAX 1000000005

#define inf 1e9

#define INF 1e18

#define MOD 1000000007

//#define MOD 4294967296another

#define MIN 0





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

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

//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

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



/**------------------------------------BITMASK------------------------------------------**/

//int Change(int N, int pos){return N= N^(1<<pos);}

//bool Check(int N, int pos){return (bool)(N &(1<<pos));}

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



using namespace std;



int main()

{

    int n;

    scanf("%d", &n);





    int a[n];



    rep(i, 0, n)

    {

        scanf("%d", &a[i]);

    }







    sort(a, a+n);





    int ans = a[n/2]-a[n/2-1];



    printf("%d\n", ans);



    return 0;

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

using namespace std;

const int MAX_n=1e5;

int n;

int d[MAX_n+10];

bool comp(int a,int b)

{

    return a<b;

}

int main()

{

    cin>>n;

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

    {

        cin>>d[i];

    }

    sort(d+1,d+n+1,comp);

    if(d[n/2]==d[n/2+1])

    {

        cout<<"0";

        return 0;

    }

    cout<<d[n/2+1]-d[n/2];

    return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

    int n,d[200000],i,j;

    while(~scanf("%d",&n))

    {

        int acm=0;

        for(i=1;i<=n;i++)

            scanf("%d",&d[i]);

        sort(d+1,d+n+1);

        if(n%2!=0||d[n/2]==d[n/2+1])

            acm=0;

        else

            acm+=d[n/2+1]-d[n/2];

        printf("%d\n",acm);

    }

    return 0;

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

using namespace std;

typedef long long ll;

const ll MAXN=1e5+5;

const ll MOD=998244353;

const ll INF=1e18;

ll n,a[MAXN];



void solve()

{

    sort(a+1,a+1+n);

    printf("%lld\n",a[n/2+1]-a[n/2]);

}

int main()

{

//    freopen("c://duipai//data.txt","r",stdin);

//    freopen("c://duipai//wa.txt","w",stdout);

    while(~scanf("%lld",&n))

    {

//        string ss;

//        cin>>ss;

//        cout<<ss<<endl;

       // solve();

        for(ll i=1;i<=n;i++)

        {

            scanf("%lld",&a[i]);

        }

        solve();

    }

}

/*

5

76578820211343624  293297008968192 189152283861189120 324294649604739072 20266198324215808

*/


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

#include<algorithm>

using namespace std;

int main()

{

    int n,d[200000],i,j;

    while(~scanf("%d",&n))

    {

        int acm=0;

        for(i=1;i<=n;i++)

            scanf("%d",&d[i]);

        sort(d+1,d+n+1);

        if(n%2!=0||d[n/2]==d[n/2+1])

            acm=0;

        else

            acm+=d[n/2+1]-d[n/2];

        printf("%d\n",acm);

    }

    return 0;

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



#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")



typedef long long ll;

typedef unsigned long long ull;

// typedef __int128_t lll;

#define fatnet ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);



using namespace std;



const ll MOD1 = 1e9 + 7;

const ll MOD2 = 2000003983; // 3571 1e9 + 97

const ll MOD3 = 1e9 + 9;

const ll p1 = 1e6 + 3;

const ll p2 = 2017; // 131 37

const ll p3 = 37;

const ll INF = 5e18;



int main() {

    fatnet;



    ll n;

    cin >> n;

    vector < ll > a(n);

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

        cin >> a[i];

    sort(a.begin(), a.end());

    cout << a[n / 2] - a[n / 2 - 1] << "\n";



    return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

    int n,d[200000],i,j;

    while(~scanf("%d",&n))

    {

        int acm=0;

        for(i=1;i<=n;i++)

            scanf("%d",&d[i]);

        sort(d+1,d+n+1);

        if(n%2!=0||d[n/2]==d[n/2+1])

            acm=0;

        else

            acm+=d[n/2+1]-d[n/2];

        printf("%d\n",acm);

    }

    return 0;

}
// Slower C++ solution:
#include <iostream> 

#include <algorithm>

using namespace std;



int n,arr[100000];

int main(){

	cin>>n;

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

		cin>>arr[i]; 

	} 

	sort(arr,arr+n); 

	int sum=arr[n/2]-arr[n/2-1];

	cout<<sum;

	return 0; 

} 

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

#include<algorithm>

using namespace std;

int main()

{

    int n,d[200000],i,j;

    while(~scanf("%d",&n))

    {

        int acm=0;

        for(i=1;i<=n;i++)

            scanf("%d",&d[i]);

        sort(d+1,d+n+1);

        if(n%2!=0||d[n/2]==d[n/2+1])

            acm=0;

        else

            acm+=d[n/2+1]-d[n/2];

        printf("%d\n",acm);

    }

    return 0;

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

using namespace std;

const int MAX_n=1e5;

int n;

int d[MAX_n+10];

bool comp(int a,int b)

{

    return a<b;

}

int main()

{

    cin>>n;

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

    {

        cin>>d[i];

    }

    sort(d+1,d+n+1,comp);

    if(d[n/2]==d[n/2+1])

    {

        cout<<"0";

        return 0;

    }

    cout<<d[n/2+1]-d[n/2];

    return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n,i,b,a[100005];

	while(~scanf("%d",&n))

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

	 scanf("%d",&a[i]);

	 sort(a,a+n);

	 printf("%d\n",a[n/2]-a[n/2-1]);

	}

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

using namespace std;

typedef long long ll;

const ll MAXN=1e5+5;

const ll MOD=998244353;

const ll INF=1e18;

ll n,a[MAXN];



void solve()

{

    sort(a+1,a+1+n);

    printf("%lld\n",a[n/2+1]-a[n/2]);

}

int main()

{

//    freopen("c://duipai//data.txt","r",stdin);

//    freopen("c://duipai//wa.txt","w",stdout);

    while(~scanf("%lld",&n))

    {

//        string ss;

//        cin>>ss;

//        cout<<ss<<endl;

       // solve();

        for(ll i=1;i<=n;i++)

        {

            scanf("%lld",&a[i]);

        }

        solve();

    }

}

/*

5

76578820211343624  293297008968192 189152283861189120 324294649604739072 20266198324215808

*/


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

#include<algorithm>

using namespace std;

int main()

{

	int n,i,b,a[100005];

	while(~scanf("%d",&n))

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

	 scanf("%d",&a[i]);

	 sort(a,a+n);

	 printf("%d\n",a[n/2]-a[n/2-1]);

	}

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



#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")



typedef long long ll;

typedef unsigned long long ull;

// typedef __int128_t lll;

#define fatnet ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);



using namespace std;



const ll MOD1 = 1e9 + 7;

const ll MOD2 = 2000003983; // 3571 1e9 + 97

const ll MOD3 = 1e9 + 9;

const ll p1 = 1e6 + 3;

const ll p2 = 2017; // 131 37

const ll p3 = 37;

const ll INF = 5e18;



int main() {

    fatnet;



    ll n;

    cin >> n;

    vector < ll > a(n);

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

        cin >> a[i];

    sort(a.begin(), a.end());

    cout << a[n / 2] - a[n / 2 - 1] << "\n";



    return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

	int n,i,b,a[100005];

	while(~scanf("%d",&n))

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

	 scanf("%d",&a[i]);

	 sort(a,a+n);

	 printf("%d\n",a[n/2]-a[n/2-1]);

	}

}
// Slower C++ solution:
#include <iostream> 

#include <algorithm>

using namespace std;



int n,arr[100000];

int main(){

	cin>>n;

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

		cin>>arr[i]; 

	} 

	sort(arr,arr+n); 

	int sum=arr[n/2]-arr[n/2-1];

	cout<<sum;

	return 0; 

} 

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

#include<algorithm>

using namespace std;

int main()

{

	int n,i,b,a[100005];

	while(~scanf("%d",&n))

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

	 scanf("%d",&a[i]);

	 sort(a,a+n);

	 printf("%d\n",a[n/2]-a[n/2-1]);

	}

}
// 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.2460750153906748x):
#include<bits/stdc++.h>

using namespace std;

#define pb push_back

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

#define fast ios_base::sync_with_stdio(false) , cin.tie(0) ;

int main()

{

    fast ;

    int k, x ,n , i;

    vector<int>v ;

    cin >> n ;

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

    {

        cin >> x ;

        v.pb(x) ;

    }

    sort(all(v)) ;

    n = n/2 ;

    cout << v[n] - v[n-1] << "\n" ;

    return 0;

}
// 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.2764430447148831x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,i;

    cin>>n;

    int a[n];

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

    {

        cin>>a[i];

    }

    if(n%2!=0)

    {

        cout<<0;

    }

    else

    {

        sort(a,a+n);

        cout<<a[n/2]-a[n/2-1];

    }

}