import java.util.Scanner
import scala.util.control.Breaks

object Main {
  def Yenof(money_unit: String)(money: Double): Double = {
    if (money_unit.equals("BTC")) {
      money * 380000
    } else {
      money
    }
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    var x = Seq[Double]()
    var u = Seq[String]()
    0.until (N).foreach (_ => {
      x :+= sc.nextDouble()
      u :+= sc.next()
    })

    val otoshidama_yen: Seq[Double] = u.zip(x).map(unit_money => {
      val unit = unit_money._1
      val money = unit_money._2
      Yenof(unit)(money)
    })

    print(otoshidama_yen.sum)
  }
}