import java.util.Scanner;

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val num: Int = Integer.parseInt(sc.nextLine())
  var totald: Double = 0.0
  for (i in 1..num) {
    var str: String = sc.next()
    var stc: String = sc.next()
    if (stc == "BTC") {
      totald += str.toDouble() * 380000
    }
    if (stc == "JPY") {
      totald += str.toInt()
    }
  }
  println("${totald}")
}