import Data.List
import Control.Monad

rr :: IO [String]
rr = words <$> getLine

main :: IO ()
main = do
    n <- readLn :: IO Int
    xs <- replicateM n rr
    let [vs,us] = transpose xs
    let res = sum $ zipWith convert us (map read vs)
    print res


toJPY :: Double -> Double
toJPY = (*380000.0)


convert :: String -> Double -> Double
convert "JPY" = id
convert "BTC" = toJPY
