fun main(args: Array<String>) {
    val giftNums = Integer.parseInt(readLine())

    var giftsPrice = 0.0
    for(i in 1..giftNums) {
        val inputs = readLine()?.split(" ")!!
        var priceNum = inputs[0].toDouble()
        val type = inputs[1]
        if (type == "BTC") {
            priceNum *= 380000.0
        }
        giftsPrice+=priceNum
    }
    System.out.println(giftsPrice)
}
