program digital_gifts
  implicit none
  integer :: n, i, j = 0
  character(1) :: u
  real(8) :: x, b = 0.d0
  character(64) :: s
  read(*,*) n
  do i = 1, n
    read(*,*) x, u
    if (u == "J") then
      j = j+nint(x)
    else
      b = b+x
    end if
  end do
  write(s,'(f32.16)') 380000.d0*b+j
  write(*,'(a)') trim(adjustl(s))
end program digital_gifts