import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val xu = (1..n).map { Pair(sc.next(), sc.next()) }

  val ans = mutableListOf<Float>()

  for (i in 0 until n) {
    val x = xu[i].first
    val u = xu[i].second

    if (u == "JPY") {
      ans.add(x.toFloat())

    } else if (u == "BTC") {
      val btc = 380000.0

      val subs = x.split(".")
      val sub1 = subs.getOrElse(0) { "" }
      val sub2 = subs.getOrElse(1) { "" }

      val tmp1 = sub1.toLong() * btc
      val tmp2 = sub2.toLong() * btc / 100_000_000

      ans.add(tmp1.toFloat() + tmp2.toFloat())
    }
  }

  println(ans.sum())
}
