n = STDIN.gets.chomp.to_i
x = Array.new(0)
u = Array.new(0)
for i in 1..n
  a, b = STDIN.gets.chomp.split(" ")
  x.push(a.to_f)
  u.push(b)
end

result = 0.0
for i in 0..(n-1)
  if u[i] == "JPY" then
    result += x[i]
  else
    result += x[i] * 380000.0
  end
end

puts result 
