ary = Array.new
while line = $stdin.gets
ary << line.chomp.split
end
ary.delete_at(0)
okane = ary.map{|item| 
if item[1]=="BTC" then
    item[0].to_f*380000
else
    item[0]
end
}
print okane.map(&:to_f).inject(:+)