n = gets.chomp.to_i
xs = []
us = []
n.times.map.with_index(0) do |i|
  x, u = gets.chomp.split(' ')
  xs[i] = x
  us[i] = u
end

sum = 0.0
0.upto(n - 1).each do |i|
  if us[i] == 'BTC'
    yen = xs[i].to_f * 380000.0
  else
    yen = xs[i].to_f
  end
  sum += yen
end
puts sum
