n = gets.to_i

x = []
u = []
sum = []
n.times do |hoge|
    x[hoge], u[hoge] = gets.chomp.split.map(&:to_s)
    x[hoge] = x[hoge].to_f
    u[hoge] == "BTC" ? sum[hoge] = x[hoge] * 380000.0 : sum[hoge] = x[hoge]
end

puts sum.sum