n = gets.to_i
ans = STDIN.read.split("\n").reduce(0.0) do |acc,xu|
    x,u = xu.split
    case u
    when "JPY"
        acc += x.to_f
    when "BTC"
        acc += x.to_f * 380000.0
    end
    acc
end
puts ans
