input = $stdin.read.split("\n")
input = input.slice(1, input.length)
result = 0.0
input.each do |a|
  price, type = a.split(' ')
  price = price.to_f
  price *= 380_000.0 if type == 'BTC'
  result += price
end
pp result