let input_price() = Scanf.scanf "%s %s\n" @@ fun xs u ->
  let x = 
    if String.contains xs '.' then xs |> float_of_string 
    else xs |> int_of_string |> float_of_int in 
      if u = "JPY" then x 
      else x *. 380000.
;;

let () = Scanf.scanf "%d\n" @@ fun n ->
  let price = Array.init n @@ fun _ -> input_price() in
  Printf.printf "%f\n" @@ Array.fold_right (+.) price 0.
;;