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

long long n;
vector<long long> l, r;

int main() {
  cin >> n;
  l.resize(n);
  r.resize(n);
  for (int i = 0; i < n; ++i) cin >> l[i] >> r[i];
  sort(l.begin(), l.end());
  sort(r.begin(), r.end());
  if (n % 2)
    cout << r[n / 2] + 1 - l[n / 2] << endl;
  else
    cout << r[n / 2 - 1] + r[n / 2] - l[n / 2] - l[n / 2 - 1] + 1 << endl;

  return 0;
}
