'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const N = parseInt(args[0][0], 10)
	const x = new Array()
	const u = new Array()

	for (let i = 0; i < N; i++) {
		x.push(Number(args[i + 1][0]))
		u.push(args[i + 1][1])
	}

	let jpy = 0
	let btc = 0

	for (let i = 0; i < N; i++) {
		if (u[i] === 'BTC') btc += x[i]
		else jpy += x[i]
	}

	console.log(btc * 380000.0 + jpy)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
