object Main extends App {
  var a = readInt
  var i = 0
  var sum = 0.0d
  while (i<a){
    var get = readLine
    var a = get.split(" ")(0).toDouble
    var b = get.split(" ")(1).toString
  
	if(b.equals("BTC")) {
      sum += (a * 380000.0)
    } else {
      sum += a
    }
    i+=1
  }
  println(sum)
}