PROGRAM ATCODER

implicit none
real(16) :: sum, b
real(16),allocatable :: x(:)
character(len=3),allocatable :: u(:)
integer :: n, i

b = 380000.0

read(*,*) n
allocate(x(n), u(n))

do i = 1, n
	read(*,*) x(i), u(i)
end do

sum = 0

do i = 1, n
	if(u(i) == 'BTC') then
    	x(i) = x(i)*b
    end if
    sum = sum + x(i)
end do

if (sum == 0.d0) then
	write(*,'(a)') '0.0'
	stop
end if

write(*,'(f0.1)') sum

END PROGRAM ATCODER