import Control.Monad
main = do
  n <- readLn 
  ms <- replicateM n (words <$> getLine) :: IO [[String]]
  let f = foldl (\acc (d:u:_) -> if u == "JPY" then (r d)+acc else (r d)*380000.0+acc) 0.0 ms 
  print f 

r :: String -> Float
r s = read s :: Float