let () = Scanf.scanf "%d" @@ fun n ->
  let xus = Array.init n @@ fun _ -> Scanf.scanf " %f %s" @@ fun x u -> (x, u) in
  let ans = Array.fold_left (fun acm (x, u) -> acm +. if u = "JPY" then x else x *. 380000.0) 0.0 xus in
  Printf.printf "%f\n" @@ ans