local sum = 0
local n = io.read("n")
for i = 1, n do
    local num = io.read("n")
    local u = io.read()
    if u == " BTC" then
        sum = sum + num * 380000
    else
        sum = sum + num
    end
end
print(sum)