import Control.Monad

solver::[(String,String)]->Double
solver = sum.map (\(x,u)->(read x)*(if u == "BTC" then 380000 else 1))

main::IO()
main=do
  n<-return.read=<<getLine
  dat<-forM [1..n] (\_->return.(\(x:y:_)->(x,y)).words=<<getLine)
  print (solver dat)
