#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	scanf("%d", &n);
	vector<int> a(n), b(n);
	for(int i = 0; i < n; ++i) {
		scanf("%d%d", &a[i], &b[i]);
	}
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	int low = a[(n-1)/2] + a[n/2];
	int high = b[(n-1)/2] + b[n/2];
	int answer = high - low + 1;
	if(n % 2 == 1) {
		answer = (answer + 1) / 2;
	}
	printf("%d\n", answer);
}
