"use strict";
    
const main = arg => {
    const N = arg.split("\n")[0];
    const X = arg.split("\n").slice(1,N+1);
    let total = 0;
    for(let i in X) {
        let money;
        if(X[i].split(" ")[1] == "BTC") {
            money = X[i].split(" ")[0] * 380000.0;
        } else {
            money = X[i].split(" ")[0];
        }
        total += Number(money);
    }
    console.log(total);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));