object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt
  val rate = 380000.0
  var result = 0.0
  for (_ <- 0 until N) {
    val x = sc.nextDouble
    val u = sc.next
    if (u == "JPY") {
      result += x
    } else if (u == "BTC") {
      result += rate * x
    }
  }
  println(result)
}