void main() {
    int n = readln.chomp.to!int;
    double[string] rate;
    rate["JPY"] = 1.0, rate["BTC"] = 380000.0;
    double gift = 0.0;
    foreach (i; 0 .. n) {
        string[] tmp = readln.split;
        gift += tmp[0].to!double * rate[tmp[1]];
    }
    gift.writeln;
}

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