object Main {

  val amari = 1000000007

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt()
    val V = Array.fill(N, 2)(sc.next())
    println(V.map { x =>
      if (x(1) == "JPY")
        x.head.toDouble
      else
        x.head.toDouble * 380000
    }.sum)
  }
}
