import Control.Monad
main = do
  n <- readLn
  x <- replicateM n $ words <$> getLine
  print $ sum $ map f x

f y
  | last y == "JPY" = read $ head y :: Float
  | last y == "BTC" = 380000.0 * g (head y)
  | otherwise = 0.0
g z = read z :: Float