function main(input) {
  const args = input.split('\n');
  const N = parseInt(args[0], 10);
  let sum = 0;
  
  for (let i = 1; i < args.length; i++) {
    ary = args[i].split(' ');
    if (ary[1] === 'JPY') {
      sum += parseFloat(ary[0], 10);
    } else {
      sum += parseFloat(ary[0], 10) * 380000;
    }
  }
  
  console.log(sum);
}

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