class Float
  def jpy
    self.to_f
  end
  def btc
    self.to_f * 380000
  end
end

N = gets.to_i
money = N.times.map do
  x, t = gets.split
  x.to_f.send(t.downcase)
end.inject(0.0, &:+)
puts "%.6f" % money