import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val yens = parseList(sc, n)
    val sum = yens.sum()
    println(sum)
}


private fun parseList(scanner: Scanner, length: Int): List<Float> {
    return (0 until length).map {
        val value = scanner.nextFloat()
        val unit = scanner.next()
        if (unit == "BTC") {
            return@map value * 380000
        }
        return@map value
    }
}