import scala.io.StdIn._

object Main extends App {
  val n = readInt()

  require(2 <= n && n <= 10)

  var i = 0
  var j = 0.0
  while (i < n) {
    val Seq(x, u) = readLine().split(" ").toSeq
    u match {
      case "JPY" => j = j + x.toDouble
      case "BTC" => j = j + x.toDouble * 380000.0
    }
    i = i + 1
  }
  println(j)
}
