program main
  implicit none
  integer :: n, i
  double precision :: x, sum
  character(3) :: u

  read *, n

  do i = 1, n
    read *, x, u 

    if (u == 'BTC') then
      x = x * 3.8d5
    end if
    
    sum = sum + x
  end do
  
  print '(E9.4e1)', sum
end