def s()
  gets().chomp
end
def i()
  gets.to_i
end
def li()
  gets.split.map(&:to_i)
end
def ili()
  n = gets.to_i
  as = gets.split.map(&:to_i)
  [n, as]
end
class Array
  def sum
    total = 0
    self.each do |item|
      total += item
    end
    total
  end
end

n= i()
a = []
n.times{
  a<<gets.split()
}
sum = 0
a.each{|x, u|
  if u == "JPY"
    sum += x.to_f
  else
    sum += x.to_f*380000.0
  end
}

puts sum
