#include<cstdio>
#include<algorithm>

using namespace std;

long long a[300000],b[300000];

int main()
{
	int n=0;scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%lld%lld",&a[i],&b[i]);
	sort(a+1,a+n+1),sort(b+1,b+n+1);
	if(n&1){printf("%lld",b[n/2+1]-a[n/2+1]+1);}
	else printf("%lld",b[n/2]-a[n/2]+b[n/2+1]-a[n/2+1]+1);
}