n = gets.to_i
array = Array.new(n){|i| i = gets.chomp.split}
result = []
array.each do |j|
    if j[1] == 'JPY'
        result << j[0].to_f
    else
        result << (j[0].to_f * 380000.0)
    end
end
puts result.sum