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

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