let () = Scanf.scanf "%d\n" @@ fun n ->
  let xus = Array.init n @@ fun _ -> Scanf.scanf "%f %s\n" @@ fun x u -> x, u in
  Printf.printf "%.10f\n" @@ Array.fold_right (fun (x, u) -> ( +. ) @@
    if u = "JPY" then x else 380000. *. x) xus 0.