main = do
    n <- read <$> getLine
    xus <- map words <$> sequence (replicate n getLine)
    let xs = map (read . head) xus
        us = map last xus
    print $ foldl (\acc (x, u) -> acc + if u == "JPY" then 1.0 * x else 380000.0 * x) 0 (zip xs us)