import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  _  <- readLn::IO Int
  ls <- map words . lines <$> getContents
  let otoshidama = listToTuple ls
  print $sum $map btcTojpy otoshidama

listToTuple [] = []
listToTuple ([x1,x2] : xs) = ((read::String->Double)x1,x2) : listToTuple xs

btcTojpy (x,s)
  |s=="BTC" = x*380000
  |otherwise = x