import java.util.*

fun main(args:Array<String>){
    val scan=Scanner(System.`in`)
    var sum=0.0

    val n=scan.nextInt()
    var x:Double
    var u=""
    for (i in 0 until n){
        x=scan.nextDouble()
        u=scan.next()
        if (u=="BTC"){
            sum+=380000*x
        }
        else{
            sum+=x
        }
    }

    println(sum)
}