n = gets.to_i

def exchange(value:, unit:)
  case unit
  when 'BTC'
    value.to_f * 380000.0
  else
    value.to_f
  end
end

otoshidama_jpy = []
n.times do |_ni|
  value, unit = gets.split
  otoshidama_jpy << exchange(value: value, unit: unit)
end
puts otoshidama_jpy.inject(:+)
