import Control.Monad
import Text.Printf

ret [] sum = sum
ret ((x, u):xs) sum 
  | u == "JPY" = ret xs (sum + x)
  | u == "BTC" = ret xs (sum + x*380000)

main = do
  n <- read <$> getLine
  input <- (replicateM n ((\[x, y] -> (read x, y)) . words <$> getLine)) :: IO [(Double, String)]
  putStrLn $ printf "%.5f" $ ret input 0
