import java.math.BigDecimal
import java.util.Scanner

fun main(args: Array<String>) {
  val scanner = Scanner(System.`in`)
  val BTCtoJPY = BigDecimal(380000)
  var sum = BigDecimal.ZERO
  for (i in 1..scanner.nextInt()) {
    sum += scanner.nextBigDecimal() * if (scanner.next() == "BTC") BTCtoJPY else BigDecimal.ONE
  }
  scanner.close()
  print(sum)
}