program main
  implicit none
  integer :: N
  integer, allocatable :: P(:)
  integer :: i
  integer :: out
  integer :: imin
  read(*,*) N
  allocate( P(N) )
  read(*,*) P(:)
  out = 1
  imin = P(1)
  do i = 2, N
     !imin = minval(P(1:i-1))
     if (imin > P(i)) then
        imin = P(i)
     end if
     if ( imin < P(i)) then
     else 
        out = out + 1
     end if
  end do
  write(*,'(i0)') out
  deallocate( P )
  stop
end program main
