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

int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int 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 / 2) - a.at(n / 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;
  }
}
