n = gets.to_i
list = n.times.map do
  input = gets.split
  [input[0].to_f, input[1]]
end
res = 0.0
list.each do |item|
  if item[1] == "JPY"
    res += item[0]
  elsif
    res += item[0] * 380000
  end
end
puts res