Num_people = gets.to_i
sum_money = 0

for i in 1..Num_people
  otoshidama = readline.split(" ")
  
  if otoshidama[1] == "BTC"
    sum_money += 380000.0 * otoshidama[0].to_f 
  else
    sum_money += otoshidama[0].to_f
  end
end

puts sum_money