import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long N, double[] x, string[] u) {
    auto rate = u.map!(s => s == "JPY" ? 1.0 : 380000.0);
    auto ans = zip(x, rate).map!"a[0] * a[1]".sum;
    return format("%.5f", ans);
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    double[] x = new double[](cast(size_t) (N));
    string[] u = new string[](cast(size_t) (N));
    foreach (i; 0 .. cast(size_t) (N)) {
        x[i] = input.front.to!double;
        input.popFront;
        u[i] = input.front.to!string;
        input.popFront;
    }

    static if (is(ReturnType!solve == void))
        solve(N, x, u);
    else
        solve(N, x, u).writeln;
}
