fun main(args: Array<String>) {

    val bitcoinRate: Double = 380000.0
    var sum: Double = 0.0
    for (i in 1..readLine()!!.toInt()) {
        val (money, unit) = readLine()!!.split(" ")
        if (unit == "JPY") {
            sum += money.toDouble()
        } else {
            sum += money.toDouble() * bitcoinRate
        }

    }
    print(sum)
}