module IntQuadrupleSet = Set.Make (struct
  type t = int * int * int * int
  let compare = compare
end)

let () = Scanf.scanf "%d\n" @@ fun n ->
  let xys = Array.init n @@ fun _ ->
    Scanf.scanf "%d %d\n" @@ fun x y -> x, y in
  Printf.printf "%d\n" @@ 
  IntQuadrupleSet.fold (fun (rmax, rmin, bmax, bmin) -> min @@ (rmax - rmin) * (bmax - bmin))
    (Array.fold_left (fun s (x, y) ->
      IntQuadrupleSet.fold (fun (rmax, rmin, bmax, bmin) s ->
        IntQuadrupleSet.add (max x rmax, min x rmin, max y bmax, min y bmin) @@
        IntQuadrupleSet.add (max y rmax, min y rmin, max x bmax, min x bmin) s) s IntQuadrupleSet.empty)
    (IntQuadrupleSet.singleton (min_int, max_int, min_int, max_int)) xys) max_int

