#!/usr/bin/ruby

def solve(inputs)
  ans = 0
  inputs.each do |x, u|
    if u == :JPY
      ans += x
    else
      ans += 380000.0 * x
    end
  end
  ans
end

def each_case(sin)
  sin.gets
  inputs = []
  sin.each_line.map {|line|
    x, u = line.chomp.split(" ")
    inputs.push [x.to_f, u.to_sym]
  }
  yield inputs
end

each_case(STDIN) do |inputs|
  puts solve(inputs)
end


