'use strict';
function Main(input){
  const values = input.trim().split('\n');
  const N = Number(values.shift());
  const ABs = values.map((line) => {
    var row = line.trim().split(' ');
    return row.map((str) => Number(str));
  });
  let result = 0;
  let mins = [], maxs = [];

  for(let i = 0; i < N; i++){
    mins.push(ABs[i][0]);
    maxs.push(ABs[i][1]);
  }
  mins = mins.sort();
  maxs = maxs.sort();

  let median_min = 0, median_max = 0;
  if(N%2 === 0){
    median_min = (mins[N/2-1]+mins[N/2])/2;
    median_max = (maxs[N/2-1]+maxs[N/2])/2;
    result = (median_max-median_min)/0.5 + 1;
  } else {
    let idx = (N+1)/2-1;
    median_min = mins[idx];
    median_max = maxs[idx];
    result = (median_max-median_min) + 1;
  }
  console.log(result);
}

// 固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));