"use strict"
function Main(input){
  input=input.split(/\s+/);
  var N=parseInt(input.shift());
  var sum=0;
  for(let i=0;i<N;i++){
    input[2*i]=parseFloat(input[2*i]);
    if(input[2*i+1]==="BTC")input[2*i]*=380000;
    sum+=input[2*i];
  }
  console.log(sum);
}

Main(require('fs').readFileSync("/dev/stdin","utf8"));