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

int main() {
	long long N;
	cin >> N;
	vector<long long> A(N), B(N);
	for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
	sort(A.begin(), A.end()), sort(B.begin(), B.end());
	long long P = A[(N - 1) / 2] + A[N / 2], Q = B[(N - 1) / 2] + B[N / 2];
	if (N % 2 == 1) cout << Q / 2 - P / 2 + 1 << endl;
	else cout << Q - P + 1 << endl;
}