#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using Graph = vector< vector<int> >;

int main(){
	ll N;
	cin >> N;
	ll A[N],B[N];
	for (ll i = 0; i < N; i++)
	{
		cin >> A[i] >> B[i];
	}
	sort(A,A+N);
	sort(B,B+N);
	ll a,b;
	if(N%2 == 1){
		a = A[(N-1)/2];
		b = B[(N-1)/2];
		cout << b-a+1 << endl;
	}
	else{
		a=A[N/2-1]+A[N/2];
		b=B[N/2-1]+B[N/2];
		cout << b-a+1 << endl;
	}
}