! 2020.1.19
!
      program answer
      implicit none
      integer :: N
      integer,allocatable,dimension(:) :: P
      integer :: i
      integer :: j
      integer :: ans
!
      read(*,*) N
      allocate(P(N))
      read(*,*) (P(i),i=1,N)
      j=1
      ans = 1
      do i=2,N
        if(P(j) > P(i)) then
          j = i
          ans = ans+1
        end if
      end do
      write(*,*) ans
      end program answer