import Data.List (transpose)
import Data.Bool (bool)

main :: IO ()
main = do
  getLine
  xus <- map words . lines <$> getContents
  let
    [xs, us] = transpose xus
    s = sum $ zipWith (*) (map read xs) (map (bool 1.0 380000.0 . (== "BTC")) us) :: Double
  print s
