program main
   implicit none
   integer(8)::n,i
   real(8)::su,u
   character(3) a
   read(*,*)n
   su=0
   do i=1,n
      read(*,*)u,a
      if(a=="JPY")then
         su=su+u
      else
         su=su+u*380000.0
      endif
   enddo
   write(*,*)su
end program main
