local n = io.read("*n", "*l")
local sum = 0
for i = 1, n do
  local str = io.read()
  local xs, u = str:match("([%d%.]+) (%w+)")
  local x = tonumber(xs)
  if(u == "BTC") then
    sum = sum + 380000 * x
  else
    sum = sum + x
  end
end
print(string.format("%.8f", sum))
