#include<stdio.h>
#include<stdlib.h>

int tc;
int a1[2500000];
int a2[2500000];

int cmpfunc (const void * a, const void * b) {
   return ( *(int*)a - *(int*)b );
}

int main(){
	scanf("%d", &tc);
	for(int i=0; i<tc; i++){
		scanf("%d %d", &a1[i], &a2[i]);
	}	
	long long jumlah = 0;
	
	qsort(a1, tc, sizeof(int), cmpfunc);
	qsort(a2, tc, sizeof(int), cmpfunc);
	
	if(tc % 2 == 1) printf("%lld\n",a2[tc/2]-a1[tc/2]+1);

	else{
		printf("%lld\n",a2[tc/2]+a2[tc/2-1]-a1[tc/2]-a1[tc/2-1]+1);
	}
	
	return 0;
}