object Main extends App {
	val N = scala.io.StdIn.readInt

	var sum = 0.0

	for(i<-0 until N){
		val Array(a, b) = scala.io.StdIn.readLine.split(" ")
		b match {
			case "JPY" => sum += a.toDouble
			case "BTC" => sum += a.toDouble * 380000.0
		}
	}

	println(sum)

}