program abc119b
  integer n, i
  real x, total
  character(3) s
  total = 0
  read *, n
  do i = 1, n
     read *, x, s
     total = total + merge(x, x * 380000.0, s == 'JPY')
  end do
  print *, total
end program abc119b
