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

int cmpnum(const void * n1, const void * n2) {
	if (*(long *)n1 > *(long *)n2)
	{
		return 1;
	}
	else if (*(long *)n1 < *(long *)n2)
	{
		return -1;
	}
	else
	{
		return 0;
	}
}

int main(void) {

  long n;
  scanf("%ld", &n);
  long a[n],b[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld %ld", &a[i], &b[i]);
  }
  qsort(a, n, sizeof(long), cmpnum);
  qsort(b, n, sizeof(long), cmpnum);
  long min,max,ans;
  if (n%2 == 1) {
    min = a[(n-1)/2];
    max = b[(n-1)/2];
    ans = max-min+1;
  } else {
    min = a[n/2]+a[n/2-1];
    max = b[n/2]+b[n/2-1];
    ans = max-min+1;
  }
  printf("%ld\n", ans);

  return 0;
}