object Main {
  def main(args: Array[String]): Unit = {
    def toYen(inputs: String): Double = {
      val Seq(x, u) = inputs.split(" ").toSeq

      if (u == "JPY") x.toDouble
      else x.toDouble * 380000.0
    }

    val n = io.StdIn.readInt()

    val total = Iterator.continually(io.StdIn.readLine())
      .take(n)
      .map(inputs => toYen(inputs))
      .sum

    println(total)
  }
}
