module Main where

import Control.Monad
import Control.Applicative

main :: IO ()
main = do
    n <- readLn :: IO Int
    xs <- replicateM n $ (\[x, u] -> conv (read x :: Double) u) . words <$> getLine
    print . sum $ xs


conv :: Double -> String -> Double
conv n t =
    if t == "JPY" then
        n
    else
        n * 380000.0
