Program ABC119A

integer n,i
real otoshidama
real,allocatable::x(:)
character(3),allocatable::u(:)

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

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

otoshidama=0

do i=1,n
 if(u(i)=='JPY') then
  otoshidama=otoshidama+x(i)
 else
  otoshidama=otoshidama+x(i)*380000
 end if
end do

write(*,*) otoshidama

stop
end