program low_elements
  implicit none
  integer :: n, p(200000) = 0, i, x = 0, m = 1e9
  read(*,*) n
  read(*,*) p(1:n)
  do i = 1, n
    if (m > p(i)) x = x+1
    m = min(m,p(i))
  end do
  write(*,'(i0)') x
end program low_elements