program main
  implicit none
  integer :: n, i, mi, res
  integer, allocatable :: a(:)
  read (*, *) n
  allocate (a(n))
  read (*, *) a(:)
  mi = 99999999
  res = 0
  do i = 1, n
    if (a(i) <= mi) res = res + 1
    mi = min(mi, a(i))
  end do
  write (*, "(i0)") res
end program main
