function main(input) {
  const N = parseInt(input.split(" ")[0] , 10);
  var sum=0
  for(var i=0; i<N; i++){
    if(input.split("\n")[i+1].split(" ")[1]=="JPY"){
      var x=parseInt(input.split("\n")[i+1].split(" ")[0] , 10);
      sum+=x
    }else{
      var x=parseFloat(input.split("\n")[i+1].split(" ")[0] , 10);
      sum+=x*380000
    }
  }
  console.log(sum);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));