#include<bits/stdc++.h>
using namespace std;
int n,a[1<<18],b[1<<18],i;
int main(){
	cin>>n;
	for(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-1]+a[n/2])+1;
}
