fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    var sum = 0.0
    for(i in 1..N){
        val list = readLine()!!.split(" ")
        val x = list[0].toDouble()
        val u = list[1]
        sum += if(u.equals("JPY")){
            x
        } else {
            x.toYen()
        }
    }
    println(sum)
}
fun Double.toYen(): Double{
    return this * 380000
}
