def get_jpy oto
  return oto[0] if oto[1] == "JPY"
  return oto[0] * 380000.0
end
num = gets.to_i
otoshidamas = []
otoshidama = []
num.times do
  otoshidamas << gets.split(" ")
end
otoshidamas.each do|hitori|
  otoshidama << [hitori[0].to_f,hitori[1]]
end
puts otoshidama.map{|oto|get_jpy(oto)}.inject(:+)