// Problem : E - Count Median
// Contest : AtCoder - AtCoder Beginner Contest 169
// URL : https://atcoder.jp/contests/abc169/tasks/abc169_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ordered_set;	

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const ll maxN = 1e6 + 5;
const ll MOD = 1e9 + 7;

int n, l[maxN], r[maxN];
pii a[maxN];

bool check(int m) {
	int small = 0, big = 0;
	bool found = false;
	REP(i, n) {
		if (a[i].st <= m) {
			small++;
		}
		if (a[i].st <= m && a[i].nd >= m) {
			found = true;
		}
		if (a[i].nd >= m) {
			big++;
		}
	}
	//cout << m << " " << small << " " << " " << big << " " << found << endl;
	return  small - 1 >= (n / 2) && big - 1 >= (n / 2) && found;
}

bool check2(int m) {
	int small = 0, big = 0;
	bool found = false;
	REP(i, n) {
		if (a[i].st <= m) {
			small++;
		}
		if (a[i].st <= m && a[i].nd >= m) {
			found = true;
		}
		if (a[i].nd >= m) {
			big++;
		}
	}
	//cout << m << " " << small << " " << " " << big << " " << found << endl;
	return small - 1 >= (n / 2)  - 1 && big - 1 >= (n / 2) && found;
}

bool check3(int m) {
	int small = 0, big = 0;
	bool found = false;
	REP(i, n) {
		if (a[i].st <= m) {
			small++;
		}
		if (a[i].st <= m && a[i].nd >= m) {
			found = true;
		}
		if (a[i].nd >= m) {
			big++;
		}
	}
	//cout << m << " " << small << " " << " " << big << " " << found << endl;
	return small - 1 >= (n / 2) && big - 1 >= (n / 2) - 1 && found;
}


// sprawdz MODULO!
int main() {
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n;
	// REP(i, n) cin >> a[i].st >> a[i].nd;
	// sort(a, a + n);
	// if (n % 2 == 1) {
		// int lll = a[n / 2].st, rr = 1e9;
		// while (lll < rr) {
			// int m = (lll + rr + 1) / 2;
			// if (check(m)) {
				// lll = m;
			// } else {
				// rr = m - 1;
			// }
		// }
		// cout << lll - a[n / 2].st + 1 << endl;
	// } else {
		// int lll = a[n /2].st, rr = 1e9;
		// while (lll < rr) {
			// int m = (lll + rr + 1) / 2;
			// if (check3(m)) {
				// lll = m;
			// } else {
				// rr = m - 1;
			// }
		// }
		// int ans_1 = lll;
		// lll = a[n / 2 - 1].st, rr = 1e9;
		// while (lll < rr) {
			// int m = (lll + rr + 1) / 2;
			// if (check2(m)) {
				// lll = m;
			// } else {
				// rr = m - 1;
			// }
		// }
		// int x = a[n / 2].st + a[n / 2 - 1].st;
		// int y = ans_1 + lll;
		// cout << y - x + 1<< endl;
		// cout << a[n / 2].st << " " << ans_1 << "|" << " " << a[n / 2 - 1].st << " " << lll << endl;
	// }
	REP(i, n) {
		cin >> l[i] >> r[i];
	}
	sort(l, l + n); sort(r, r + n);
	if (n % 2 == 1) {
		cout << r[n / 2] - l[n / 2] + 1;
	} else {
		cout << r[n / 2] - l[n / 2] + r[n / 2 - 1] - l[n / 2 - 1] + 1;
	}
	return 0;
}
 


Measured memory_bytes: 5164