#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<tgmath.h>
#include<stdbool.h>
#include<sys/queue.h>
#include<time.h>
#define ll long long
#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))

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

int n, a[200200], b[200200];
ll ans;
main(){
    scanf("%d", &n);
    for(int i=0; i<n; i++){
        scanf("%d%d", &a[i], &b[i]);
    }
    qsort(a, n, 4, cmp);qsort(b, n, 4, cmp);
    if(n&1){
        ans = b[n/2] - a[n/2] + 1;
    }else {
        ans = b[n/2]+b[n/2-1] - a[n/2]-a[n/2-1] + 1;
    }
    printf("%lld\n", ans);
    return 0;
    return 0;
}