object Main {
  val sc = new java.util.Scanner(System.in)

  def sin(n: Int): Seq[Int] = Seq.fill(n)(sc.nextInt())

  def iin(): Int = sc.nextLine().toInt

  def main(args: Array[String]): Unit = {
    val n = iin()
    val ls = Seq.fill(n)(sc.nextDouble(), sc.nextLine())

    println(
      ls.foldLeft(0.0)(
        (b, p) => {
          b + (if (p._2 == " JPY") p._1 else p._1 * 380000.0)
        }
      )
    )
  }
}