n = gets.chomp.to_i
sum = 0

x = []
u = []
n.times do
  line = gets.chop.split(" ")
  x << line.shift
  u << line.shift  
end

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

puts sum

