program main
  implicit none
  integer :: N
  real(8),allocatable :: x(:)
  real(8) :: out
  character(len=3),allocatable :: u(:)

  integer :: i
  read(*,*) N
  allocate(x(N),u(N))
  do i = 1,N
     read(*,*) x(i),u(i)
  end do
  do i = 1,N
     if (u(i) =='BTC' ) then
        x(i) = x(i)*380000.0
     end if
  end do
  out=sum(x)
  write(*,'(f0.6)') out
  stop
end program main