n = gets
class Coin
  def initialize(val, kind)
    @val = val
    @kind = kind
  end

  def to_jpy
    if @kind == 'BTC'
      @val * 380000.0
    else
      @val
    end
  end
end

coins = []
n.to_i.times do
  i = gets
  val, kind = i.split(' ').compact
  coins << Coin.new(val.to_f, kind)
end

print coins.map(&:to_jpy).sum
