N = gets.to_i
a, brray = N.times.map{gets.split.map(&:to_s)}.transpose
array =　a.to_f
i = 0
sum = 0
while i < n
  if brray[i]　==　"JPY"
    sum +=　array[i]
  else
    sum +=　array[i]*380000
  end
  i += 1
end
puts sum