n = gets.to_i
money = Array.new(n,0.0)
ba = Array.new(n,"")
for i in 0..n-1
  inst = gets.chomp.split
  money[i] = inst[0].to_f
  ba[i] = inst[1]
end
ans = 0
for i in 0..n-1
  if ba[i] == "JPY"
    ans += money[i]
  else
    ans += money[i]*380000.0
  end
end
puts ans
