import           Control.Monad

main :: IO ()
main = do
    n  <- fmap read getLine :: IO Int
    vs <- replicateM n $ fmap words getLine :: IO [[String]]
    print $ solve vs

solve :: [[String]] -> Double
solve vs = sum $ map exchange vs

exchange :: [String] -> Double
exchange (x : u : _) =
    let y = read x :: Double in if u == "JPY" then y else y * 380000
exchange _ = 0
