fun main (args : Array<String>) {
	val n = readLine()
	val N : Int = n!!.toInt()
	var X : Float
	var U : String
	var xList : MutableList<Float> = mutableListOf()
	var uList : MutableList<String> = mutableListOf()
	var result : Double = 0.0
	for (i in 0..N - 1) {
		val (x, u) = readLine()!!.split(" ")
		X = x.toFloat()
		U = u.toString()
		xList.add(X)
		uList.add(U)
	}
	
	for (i in 0..N - 1) {
		if (uList[i] == "JPY") {
			result += xList[i]
		} else if (uList[i] == "BTC") {
			result += (xList[i] * 380000.0)
		}
	}
	
	println("${result}")
	
}