program main
  implicit none
  
  integer :: n,i
  double precision :: x,s = 0.d0,bt = 380000.d0
  character :: u
  
  read(*,*)n
  
  do i = 1, n
    read(*,*)x,u
    if (u == 'JPY') then
      s = s + x
    else
      s = s + x * bt
    end if
  end do
  write(*,*)s
end program main
  