#include <bits/stdc++.h> 
#define ll long long
using namespace std; 

/* Driver code */
int main()  
{  
    ll n, i, z;
    cin>>n;
    ll A[200000], B[200000];
    for(i=0; i<n; i++)
    cin>>A[i]>>B[i];
    sort(A, A+n);
    sort(B, B+n);
    if(n%2==1)
    {
        z = B[n/2]-A[n/2]+1;
    }
    else
    {
        z = B[n/2]+B[n/2-1]-A[n/2]-A[n/2-1]+1;
    }
    cout<<z;
    return 0;  
}  