local n = io.read("*n", "*l")
local r = 0
local r2 = 0
for i = 1, n do
  local s = io.read()
  if s:find("JPY") then
    local v = s:match("%d+")
    v = tonumber(v)
    r = r + v
  else
    local a = s:match("(%d+%.%d+)")
    a = tonumber(a)
    r = r + 380000 * a
  end
end
print(r)
