object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N = sc.nextInt()
    var jpy = BigInt(0)
    var btc = BigDecimal(0)
    (0 until N) foreach { _ =>
      val x = sc.nextBigDecimal()
      val u = sc.next()
      u match {
        case "JPY" => jpy += x.toBigInteger
        case "BTC" => btc += x
      }
    }
    println((btc * BigDecimal(380000.0)) + BigDecimal(jpy))
  }

}
