object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc. nextInt

    val list = List.fill(N)(sc.nextDouble, sc.next)

    var sum: Double = 0

    for((x,u) <- list){
      if(u == "JPY") sum += x
      else sum += x * 380000
    }

    println(sum)
  }
}
