'use strict'


const btc = 380000.0
function main(input) {
  input = input.split('\n')
  const n = ~~input[0]
  const gain = input.slice(1).map(v => v.split(' '))
  let sum = 0;
  for (let i = 0; i < n; i++) {
    sum += gain[i][1] == 'JPY' ? ~~gain[i][0]:Number(gain[i][0]) * btc
  }
  console.log(sum)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
