import java.util.*

private fun readInts() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }
private fun readDoubles() = readLine()!!.split(" ").map { it.toDouble() }
private fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V> = LinkedHashMap(this)
private fun <K, V> mutableMapOf(): MutableMap<K, V> = LinkedHashMap()
private fun <K, V> mutableMapOf(vararg pairs: Pair<K, V>) = pairs.toMap().toMutableMap()

fun main(args: Array<String>) {
    val N = readInts()[0]
    val xu = (0 until N)
        .map { readLine()!!.split(" ").let { it[0].toFloat() to it[1] } }
        .toList()

    var btc = 0.0
    var yen = 0.0

    xu.forEach {
        val (x, u) = it
        if (u == "BTC") {
            btc += x
        } else {
            yen += x
        }
    }

    println(yen + (btc * 380000.0))
}