let rec sum lst = match lst with
  | [] -> 0.
  | head :: tail -> head +. sum tail
let () =
  let n = Scanf.scanf "%d\n" (fun x -> x) in
  let lst = Array.to_list
      (Array.init n (fun _ -> Scanf.scanf "%f %s\n" (fun x u -> if u = "JPY" then x else x *. 380000.))) in
  Printf.printf "%f\n" (sum lst)
