open Printf open Scanf
open Array

let () = scanf " %d" @@ fun n ->
  printf "%.120f" (
    init n (fun _ -> scanf " %f %s" @@ fun x -> function
    | "BTC" -> x *. 380000.
    | "JPY" -> x
    ) |> fold_left (+.) 0.
  )