void main()
{
  import std.stdio, std.conv, std.string;
  immutable n = readln.chomp.to!size_t;
  real sum = 0;
  foreach (i; 0..n)
  {
    auto buf = readln.chomp.split;
    sum += (buf[0].to!real * (buf[1] == "JPY"?1:380000));
  }
  sum.writeln;
}
