n = gets.to_i
a, brray = n.times.map{gets.split.map(&:to_s)}.transpose
array = a.map{|x| x.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
