import Control.Monad

toYen :: [String] -> Float
toYen [x, unit] = if unit == "BTC"
                  then i * 380000
                  else i
  where i = read x

main :: IO ()
main = do
  n <- readLn
  xs <- replicateM n $ toYen . words <$> getLine
  print $ sum xs