let n = read_int()
let a = Array.make n 0
let b = Array.make n 0

let () =
  for i = 0 to n - 1 do
    Scanf.scanf " %d %d" (fun x y ->
      a.(i) <- x;
      b.(i) <- y
    )
  done;
  let sort = Array.sort (fun x y -> x - y) in
  sort a;
  sort b;
  let ans = b.(n / 2) - a.(n / 2) + 1 + (lnot n land 1) * (b.(n / 2 - 1) - a.(n / 2 - 1)) in
  Printf.printf "%d\n" ans
