#include<stdlib.h>
#define ll long long
int up(const void*a,const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
ll a[2<<17],b[2<<17];i,n;
main(){
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%lld%lld",a+i,b+i);
qsort(a,n,sizeof(ll),up);qsort(b,n,sizeof(ll),up);
if(n%2)printf("%lld",b[n/2]-a[n/2]+1);else printf("%lld",b[n/2]+b[n/2-1]-a[n/2]-a[n/2-1]+1);
}