import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()

    var total = 0.0
    val btc = 380000.0
    for (i in 0 until n) {
        val suji: Double = sc.nextDouble()
        val unit: String = sc.next()

        if (unit == "JPY") {
            total += suji
        } else {
            total += (suji * btc)
        }
    }
    print(total)
}