import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val xu = Array.fill(n)(readLine().split(" "))
    .map(list => (list(0).toDouble, list(1)))

  def solve() = {
    xu.foldLeft(0d) { case (acc, (x, u)) =>
      if(u == "JPY") acc + x
      else acc + x * 380000
    }
  }
  println(solve())

}

