import Control.Monad

main :: IO ()
main = do
  n <- readLn
  xus <- replicateM n getLine
  print $ solve xus

solve :: [String] -> Double
solve [] = 0.0
solve (xu:xus)
  | u == "JPY" = x + solve xus
  | u == "BTC" = x * 380000.0 + solve xus
  where
    x = read $ head $ words xu
    u = last $ words xu
  
