fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var sum = 0.0
    for (i in 1..n) {
        val xu = readLine()!!.split(' ')
        if (xu[1].equals("JPY")) sum += xu[0].toDouble()
        else sum += (xu[0].toDouble() * 380000.0)
    }
    println(sum)
}