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


int main(){
  int64_t N;
  cin >> N;
  vector<int64_t> A(N),B(N);
  for(int64_t i=0;i<N;i++){
    cin >> A.at(i) >> B.at(i);
  }
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  if(N%2==1){
    cout << B.at((N-1)/2)-A.at((N-1)/2)+1 << endl;
  }else{
    cout << B.at(N/2-1)+B.at(N/2)-A.at(N/2-1)-A.at(N/2)+1 << endl;
  }
  
}