module kkk
  sub main()
    
    dim n as integer = Integer.Parse(Console.ReadLine)
    dim p() as integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine.Split(" "), AddressOf Integer.Parse)
    
    dim i as long
    dim cnt as long
    dim max as long
    
    max = p(0)
    
    for i = 0 to n - 1
    if max >= p(i) then
      max = p(i)
      cnt = cnt + 1
    end if
    
    
    
next

console.writeline(cnt)

end sub
end module
    
    
    
      