#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+5;
ll n,a[maxn],b[maxn],c[maxn],cost;
int main()
{
	std::ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i]>>b[i];
	}
	sort(a, a + n);
	sort(b, b + n);
	if (n % 2) {
		cout << b[n/2]-a[n/2]+1;
	}
	else {
		cout <<b[n/2-1]+ b[n / 2] - a[n/2]-a[n / 2 - 1] + 1;

	}
}
