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

int hayamin(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int N;
int A[271828], B[271828];

int main(void) {
	int i;
	int ayane, asumi;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d" ,&A[i], &B[i]) != 2) return 1;
	}
	qsort(A, N, sizeof(*A), hayamin);
	qsort(B, N, sizeof(*B), hayamin);
	if (N % 2 == 0) {
		ayane = A[N / 2 - 1] + A[N / 2];
		asumi = B[N / 2 - 1] + B[N / 2];
	} else {
		ayane = A[N / 2];
		asumi = B[N / 2];
	}
	printf("%d\n", asumi - ayane + 1);
	return 0;
}
