input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
N = lines.shift() * 1
sum = 0
for (i=0; i<N; i++) {
    line = lines[i].split(' ')
    x = line[0] * 1
    y = line[1]
    if (y == 'BTC') {
        x *= 380000.0
    }
    sum += x
}
console.log(sum)
