program ccc
implicit none

integer :: n, m, i, res
integer,allocatable,dimension(:) :: p

read*, n
allocate(p(n))
read*, p

res = 0
m   = p(1)
do i = 1, n
if (p(i)<=m) then
res = res + 1
m = p(i)
end if
end do

print*, res

end program