fun main(args: Array<String>) {
  val N = readLine()!!.toInt()
  val x = (1..N).map{
    val v = readLine()!!.split(" ").map{it.toString()}
    if(v.get(1) == "JPY") {
      v.get(0).toDouble()
    } else {
      v.get(0).toDouble() * 380000
    }
  }
  println(x.sum())
}