#include <cstdio>
#include <algorithm>

using namespace std;

#define MAX_N 200005

int N;
int A[MAX_N], B[MAX_N];

void solve() {
  sort(A, A+N);
  sort(B, B+N);
  printf("%d\n", (N%2 == 1 ? B[N/2]-A[N/2] : (B[N/2]+B[(N-1)/2]-A[N/2]-A[(N-1)/2]))+1);
}

int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", A+i, B+i);
  }
  solve();
}
