import Data.List
import Debug.Trace

ans :: Int -> IO Double
ans 0 = return 0
ans n = do
  [x',u] <- words <$> getLine
  let x = read x' :: Double
  pre <- ans (n-1)
  if u == "JPY" then return $ x + pre
    else return $  x*380000 + pre


main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    answer <- ans n
    print answer
