input = STDIN.readlines.map{|line|line.strip.split()}
line = input.shift
n = line[0].to_i
sum = 0
input.each do |s|
    x = s[0].to_f
    if s[1] == 'BTC' then
        x *= 380000.0
    end
    sum += x
end
puts(sum)
