// Sakhiya07 - Yagnik Sakhiya
 
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
 
#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 10000;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
 
void solve()
{
    ll n;
    cin >> n;
    pair<ll,ll> p[n];
    ll mini = 1e10,maxi = 0;
    for(ll i=0;i<n;i++) {  cin >> p[i].ff >> p[i].ss;  mini = min(mini,p[i].ff) ; maxi = max(maxi,p[i].ss);}
    sort(p,p+n);
    if(n%2)
    {
        ll low = mini,high = maxi,ans;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2)  
            {
                high = mid - 1;
            }
            else if(mota>n/2)
            {
                low = mid + 1;
            }
            else
            {
                low = mid + 1;
                ans = mid;
            }
        }
        low = mini,high = maxi;
        ll ans1=-1;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2)  
            {
                high = mid - 1; 
            }
            else if(mota>n/2)
            {
                low = mid + 1;
            }
            else
            {
                high = mid - 1;
                ans1 = mid;
            }
        }
        cout<<ans-ans1+1;
    }
    else
    {
        ll low = mini,high = maxi,ans;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2-1)  
            {
                high = mid - 1;
            }
            else if(mota>n/2)
            {
                low = mid + 1;
            }
            else
            {
                low = mid + 1;
                ans = mid;
            }
        }
        low = mini,high = maxi;
        ll ans1=-1;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2-1)  
            {
                high = mid - 1; 
            }
            else if(mota>n/2)
            {
                low = mid + 1;
            }
            else
            {
                high = mid - 1;
                ans1 = mid;
            }
        }
        ll f_nano = ans1,f_moto = ans;
        low = mini,high = maxi;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2)  
            {
                high = mid - 1;
            }
            else if(mota>n/2-1)
            {
                low = mid + 1;
            }
            else
            {
                low = mid + 1;
                ans = mid;
            }
        }
        low = mini,high = maxi;
        ans1=-1;
        while(low<=high)
        {
            ll mid = (low + high)/2;
            ll nana = 0,mota = 0,vachche = 0;
            for(ll i=0;i<n;i++)
            {
                if(p[i].ss<mid)   nana++;
                else if(p[i].ff>mid)   mota++;
                else                   vachche++; 
            }
            if(nana>n/2)  
            {
                high = mid - 1; 
            }
            else if(mota>n/2-1)
            {
                low = mid + 1;
            }
            else
            {
                high = mid - 1;
                ans1 = mid;
            }
        }
        ll s_nano = ans1,s_moto = ans;
        cout<<(s_moto + f_moto - s_nano - f_nano + 1); 
    }
}

int main()
{
     FAST;
     ll t = 1;
   //  cin >> t;
     while(t--)
     {
          solve();
     }
}

Measured memory_bytes: 6784