import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = {
    val n = sc.nextInt
    val tuple = List.fill(n){(sc.next, sc.next)}

    val res = tuple.foldLeft(0.0d){(r, t) =>
      r  + (if(t._2 == "BTC") t._1.toDouble * 380000.0 else t._1.toLong)
    }

    println(res)

  }
}
