fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    var yen = 0L
    var btc = 0L
    for(i in (1..n)) {
        val inpt = readLine()!!.split(" ")
        if(inpt[1] == "JPY") {
            yen+= inpt[0].toLong()
        } else {
            btc += (inpt[0].toDouble()*100000000).toLong()
        }
    }
    val ans = yen + (btc/100000000.0)*380000.0
    println("%.4f".format(ans))
}