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

int main() {
  long N;
  cin >> N;
  vector<long> A(N), B(N);
  for (long 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) {
    cout << B.at(N / 2) - A.at(N / 2) + 1 << "\n";
  } else {
    cout << B.at(N / 2 - 1) + B.at(N / 2) - A.at(N / 2 - 1) - A.at(N / 2) + 1 << "\n";
  }
}