import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const N = readln.chomp.to!long;

    double res = 0;
    foreach (i; 0..N) {
        const tmp = readln.split;
        auto value = tmp[0].to!double;
        if (tmp[1] == "BTC") value *= 380000;
        res += value;
    }
    writeln(res);
}

