import java.math.BigDecimal

fun main(args:Array<String>) {
    val person = readLine()!!.toInt()
    var total = 0.0.toDouble()
    var totalBitcoin = BigDecimal.ZERO
    (1..person).forEach {
        val (v,u) = readLine()!!.split(" ")
        if(u == "JPY") {
            total += v.toInt()
        } else {
            totalBitcoin += BigDecimal(v.toDouble())
        }
    }
    val ans = BigDecimal(total) + (totalBitcoin * BigDecimal(380000))
    println(ans.toPlainString())
}
