#include <bits/stdc++.h>
using namespace std;
int main()
  {int N; cin >> N;
  vector<int> As(N), Bs(N);
  for (int i = 0; i < N; ++i) cin >> As[i] >> Bs[i];
  sort(As.begin(), As.end()); sort(Bs.begin(), Bs.end());
  int m = (N - 1) / 2, L = As[m], R = Bs[m];
  if (N % 2 == 0)
    {L += As[m + 1]; R += Bs[m + 1];}
  cout << R - L + 1 << endl;}