import Control.Monad
import Data.List

main = do
    n <- readLn  -- :: IO Int
    -- xus <- words <$> getLine
    xus <- replicateM n (words <$> getLine)  -- :: IO [[String]]
    -- let [x,u] = transpose xus
    print . sum $ map solve xus

solve :: [String] -> Double
solve (x:u:[]) = if u == "JPY" then read x else (read x) * 380000