let input_price() = Scanf.scanf "%f %s\n" @@ fun x u ->
  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.
;;