open System

let n = stdin.ReadLine() |> int

let yen x u =
    match u with
    | "JPY" -> x
    | "BTC" -> x * 380000.0
    

[0..n-1]
|> List.map (fun a -> stdin.ReadLine().Split(' '))
|> List.map (fun a -> yen (float a.[0]) a.[1])
|> List.sum
|> printfn "%f"