let _ =
  let sum = ref 0. in
  Scanf.scanf " %d" @@ fun n ->
    for _ = 1 to n do
      Scanf.scanf " %f %s" @@ fun x u ->
        sum := !sum +. if u = "BTC" then x *. 380000.0 else x
    done;
  Printf.printf "%f\n" !sum