n = gets.chomp.to_i

total = 0.0
n.times do
    line = gets.chomp.split(" ")
    value = line[0].to_f
    if line[1] == "JPY"
        total += value
    else
        total += (value * 380000.0)
    end
end

puts total
