#!/bin/ruby

n = gets.chomp.to_i
otoshidamas = []
n.times do |i|
  otoshidamas[i] = gets.chomp.split(" ")
end
total = 0
otoshidamas.each do |otoshidama|
  value = otoshidama[0].to_f
  if otoshidama[1] == 'JPY'
    total += value
  else
    total += value * 380000.0
  end
end
puts total
