let dir = function "R" -> 0 | "U" -> 1 | "L" -> 2 | _ -> 3
let foi = float_of_int
let () =
  Scanf.scanf "%d" @@ fun n ->
  let xyd = Array.init n (fun _ -> Scanf.scanf " %d %d %s" @@ fun x y d -> x, y, dir d) in

  let calc d =
    let fld, v0 = if d < 2 then max, min_int else min, max_int in
    let f = if d mod 2 = 0 then (fun x y -> x) else (fun x y -> y) in
    let ic, dc, cc = Array.fold_left (fun (ic, dc, cc) (x,y,d') ->
      if d = d' then                  (fld ic (f x y), dc, cc)
      else if (d-d'+4) mod 4 = 2 then (ic, fld dc (f x y), cc)
      else                            (ic, dc, fld cc (f x y))
    ) (v0, v0, v0) xyd in
    [ (dc - ic); 2 * (dc - cc); 2 * (cc - ic) ]
  in

  let area t =
    let xm, xM, ym, yM = Array.fold_left (fun (xm, xM, ym, yM) (x, y, d) ->
        let x, y = foi x, foi y in
        let x, y = match d with 0 -> x +. t, y | 1 -> x, y +. t
                              | 2 -> x -. t, y | _ -> x, y -. t
        in
        min xm x, max xM x, min ym y, max yM y
    ) (1e10, -.1e10, 1e10, -.1e10) xyd in
    (xM -. xm) *. (yM -. ym)
  in

  [0; 1; 2; 3] |> List.map calc |> List.concat
  |> List.fold_left (fun a t ->
      if t < 0 || 1000000 <= t then a else min a (area (foi t /. 2.))) max_float
  |> Printf.printf "%.10f\n"
