object Main extends App {
    val n = scala.io.StdIn.readLine().toInt
    var result = 0.toDouble
    for {i <- 1 to n} {
      val Array(x,u) = scala.io.StdIn.readLine().split("\\s")
      if (u == "JPY") {
        result += x.toDouble
      } else {
        result += x.toDouble * 380000
      }
    }
    println(result)
}