# ABC 119 B

# input
n = gets.to_i
x = Array.new(n)
u = Array.new(n)
(0..n-1).each do |i|
    x[i],u[i] = gets.chomp.split(" ")
    x[i] = x[i].to_f
end

sum = 0
(0..n-1).each do |i|
    if u[i] == "JPY"
        sum += x[i]
    else
        sum += x[i] * 380000.0
    end
end

puts sum
