local function btc2jpy(btc)
    return btc * 380000.0
end
local N = io.read("n")
local total_in_jpy = 0.0
for i=1,N do
    local amount, _, currency = io.read("n", 1, 3, "l")
    --print(amount, currency, string.len(currency))
    if currency == 'BTC' then
        amount = btc2jpy(amount)
    end
    total_in_jpy = total_in_jpy + amount
end
print(total_in_jpy)
