private fun readInts() = readLine()!!.split(" ").map { it.toInt() }

fun main(args: Array<String>) {
    val (N) = readInts()
    val xu = (0 until N).map { readLine()!!.split(" ") }

    var yen = 0
    var coin = 0.0
    for ((x, u) in xu) {
        if (u == "JPY") {
            yen += x.toInt()
        } else {
            coin += x.toDouble()
        }
    }
    println(yen + coin * 380000.0)
}