#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;

int N,A[200000],B[200000];

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