# coding: utf-8
class Case02

  def initialize
  end

  def show
    p self.instance_variables
        .map{ |sym| [sym, self.instance_variable_get(sym)] }
        .to_h
  end
  
  # 実行する
  def execute
    read
    solve
    output
  end

  # 読込
  def read
    @n = gets.chomp.to_i
    @xu = []
    @n.times do
      x, u = gets.chomp.split
      @xu << [x.to_f, u]
    end
  end

  # 回答
  def solve
    @result = @xu.reduce(0.0) do |tmp, e|
      if e[1] == 'JPY'
        tmp + e[0] 
      else
        tmp + e[0] * 380000.0 
      end
    end
    # tmp = 0.0
    # @xu.each do |e|
    #   if e[1] == 'JPY' then
    #     tmp += e[0] 
    #   else
    #     tmp += e[0] * 380000.0
    #   end
    # end
    # @result = tmp
  end
  
  # 出力
  def output
    puts @result
  end

end

# 
Case02.new.execute if $0 == __FILE__

