main :: IO ()
main = do
  n <- readLn
  solve n 0.0

solve :: Int -> Double -> IO ()
solve 0 m = print m
solve n m = do
  [x, u] <- words <$> getLine
  case u of
    "JPY" -> solve (n - 1) (m + toDbl x)
    "BTC" -> solve (n - 1) (m + 380000.0 * toDbl x)
  where
    toDbl :: String -> Double
    toDbl s = read s :: Double
