import Control.Monad
import Data.List
import Control.Applicative

readPair :: IO (Double, String)
readPair = do
  [n, s] <- words <$> getLine
  let num = read n :: Double
  return (num, s)

f :: Double -> (Double, String) -> Double
f acc (d, s)
  | s == "JPY" = d + acc
  | otherwise  = d * 380000.0 + acc

main :: IO ()
main = do
  n <- readLn :: IO Int
  ylist <- replicateM n readPair
  print $ foldl f 0.0 ylist
