var btc_rate = 380000.0;
function main(input){
  var sum = 0;
  input.split("\n").filter((v,i)=>i>0).forEach(v=>{
    var a = Number(v.split(" ")[0]);
    var b = v.split(" ")[1];
    sum += Number(b=='JPY'?a:a*btc_rate);
  });
  console.log(sum);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))