program B3
  implicit none

  integer :: n, i , j, cnt, min
  integer,allocatable,dimension(:) :: P

  read(*,*) n
  allocate(P(n))
  read(*,*) (P(j), j=1,n)

  cnt=1
  min=P(1)
  do i=2,n
     if(P(i).gt.min)  goto 300
     ! do j = 1,i-1
     !    if(P(j).lt.P(i))  then
     !       goto 300
     !    endif
     ! enddo
     cnt=cnt+1
     min=P(i)
300  continue     
  enddo

  print *, cnt
  
end program B3