lines = []
while line = gets
    lines << line.chomp.split(' ')
end

N = lines[0][0].to_i

ans = 0.0
for i in 1..N do
  if lines[i][1] == "JPY" then
    ans += lines[i][0].to_f
  else
    ans += lines[i][0].to_f * 380000.0
  end
end
puts ans