object Main{
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt()
    var ans = BigDecimal(0)

    (1 to n).foreach(_ =>{
      val x = BigDecimal(sc.next())
      val u = sc.next("JPY|BTC")
      if(u == "BTC") ans += x*BigDecimal(380000.0) else ans += x
    })

    println(ans)
  }
}