const fs = require('fs');

const main = (input) => {
  const [n, ...tail] = input;
  
  const money = tail
    .map(x => x.split(' '))
    .map(([n, type]) => conv(Number(n), type))
    .reduce((acc, x) => acc + x, 0);

  console.log(money);
};

const conv = (n, type) => {
  if (type === 'JPY') {
    return n;
  } else if (type === 'BTC') {
    return n * 380000.0;
  }
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n'));
