fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    var total = 0.0
    for (i in 0 until n) {
        val (x, type) = readLine()!!.split(" ")
        total += if (type == "BTC") x.toDouble() * 380000 else x.toDouble()
    }
    print(total)
}