#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x,y,n;cin >>n;
  vector<long double> a(n);
  vector<long double> b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cin >> b[i];
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  if(n%2==1){
    x=a[n/2];
    y=b[n/2];    
  }else{
    x=(a[n/2]+a[n/2-1]);
    y=(b[n/2]+b[n/2-1]);
  }

    cout<< y-x+1 <<endl;
}