import scala.io.StdIn._
object Main extends App {
  println((1 to readInt).map { _ =>
    readLine.split(" ") match {
      case Array(x, "JPY") => x.toDouble
      case Array(x, _)     => x.toDouble * 380000
    }
  }.sum)
}
