implicit none
integer n,i
integer,parameter:: bit=380000
real x,sum
character u*3

read(5,*)n

sum=0

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

if(u.eq."BTC") then
sum=sum+x*bit
else
sum=sum+x
endif

enddo

write(6,*) sum



end