[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let conv (x, y) =
    match y with
    | "BTC" -> x * 380000.0
    | _ -> x

[<EntryPoint>]
let main argv =
    let n = read int
    let xus = List.map (fun _ -> reads id |> fun [x;y] -> (float x, y)) [1..n]
    List.fold (fun x y -> x + conv y) 0.0 xus
    |> printfn "%f"
    0