import Control.Monad

data Type = BTC | JPY

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    ns <- replicateM n ((\[a, b] -> if b == "JPY" then read a else 380000.0 * read a) . words <$> getLine) :: IO [Double]
    print $ sum ns
    