import scala.io.{StdIn => in}

object Main extends App {
  val btc = 380000.0
  val n = in.readInt
  val ans = Iterator.continually(in.readLine)
    .take(n)
    .map(_.split(" "))
    ./:(0.0)((acc, e) => {
      val v = if(e(1) == "JPY") e(0).toDouble else e(0).toDouble * btc
      acc + v
    })
  println(ans)
}