program main
  implicit none
  integer :: n, i
  real(8) :: x, res
  character(3) :: u
  read (*, *) n
  res = 0.0
  do i = 1, n
    read (*, *) x, u
    if (u == "BTC") x = x * 380000
    res = res + x
  end do
  write (*, *) res
end program main
