function Main(input) {
	input = input.split("\n");
	tmp = input[1].split(" ");
	var a = parseInt(input[0], 10);
  	var p = 0;
  	for(var i = 1;i<a+1;i++)
    {
		var tmp = input[i].split(" ");
		p += tmp[0] * (tmp[1]=="JPY"?1:380000);
    }
	console.log(p);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));