object Main extends App {
  val sc = new java.util.Scanner(System.in)
  println {
    List.fill(sc.nextInt())(sc.nextDouble() -> sc.next()).map {
      case (d, "BTC") => d * 380000.0
      case (d, _) => d
    }.sum
  }
}
