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

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