let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.make n 0 in
  let bs = Array.make n 0 in
  for i = 0 to n - 1 do
    Scanf.scanf "%d %d\n" @@ fun a b ->
      as_.(i) <- a;
      bs.(i) <- b
  done;
  Array.sort compare as_;
  Array.sort compare bs;
  Printf.printf "%d\n" @@
  if n mod 2 = 1
  then bs.(n / 2) - as_.(n / 2) + 1
  else bs.(n / 2) + bs.(n / 2 - 1) - as_.(n / 2) - as_.(n / 2 - 1) + 1

