n = gets.chomp.to_i
otoshi = 0.0

n.times do|i|
    ar = gets.chomp.split(" ")
    x = ar[0].to_f
    u = ar[1]
    if u == "JPY" then
        otoshi += x
    else
        otoshi += (x*380000.0)
    end
end
puts otoshi