N = gets.to_i

sum = 0
x=[]
u=[]

for i in 0..N-1 do
  x[i], u[i] = gets.split(" ")
end

for i in 0..N-1 do
  if u[i] == "JPY"
    sum += x[i].to_i
  else
    sum += 380000.0 * (x[i].to_f)
  end
end

puts sum
