const main = stdin => {
  const input = stdin.trim().split('\n')
  const N = parseInt(input[0])

  let sum = 0
  for (let i = 0; i < N; i++) {
    const [price, currency] = input[i + 1].split(' ')
    if (currency === 'BTC') {
      sum += parseFloat(price) * 380000
    } else {
      sum += parseFloat(price)
    }
  }

  console.log(sum)
}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
