#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}

ll a[200010],b[200010];
int main(){
	int n;
	scanf("%d",&n);
	rep(i,0,n)scanf("%lld%lld",a+i,b+i);
	sortup(a,n);
	sortup(b,n);
	if(n%2==1)printf("%lld\n",b[n/2]-a[n/2]+1);
	else printf("%lld\n",b[n/2]+b[n/2-1]-a[n/2]-a[n/2-1]+1);
}