import Control.Monad

main = do
    n  <- read <$> getLine
    xu <- forM [1..n] $ \i -> do
        [x, u] <- words <$> getLine
        return (read x, u)
    putStrLn $ show $ solve n xu

solve :: Int -> [(Double, String)] -> Double
solve n xu = sum [if u == "JPY" then x else x * 380000 | (x, u) <- xu]
