N = gets.chomp.to_i

x = []
u = []
N.times do
    a, b = gets.split(' ')
    x << a
    u << b
end

sum = 0
N.times do |i|
    if u[i].eql?('JPY') then
        sum = sum + x[i].to_i
    else
        sum = sum + x[i].to_f * 380000.0
    end
end

print sum