from sys import stdin



def main():

    n = int(stdin.readline().strip())

    l = list(map(int,stdin.readline().split()))

    ar = [-1 for _ in range(n)]

    ar[0] = l[0]

    ans = 1

    for i in range(1,n):

        if(l[i] <= ar[i-1]):

            ans+=1

            ar[i] = l[i]

        else:

            ar[i] = ar[i-1]

    print(ans)

        

main()

_ = int(eval(input()))

numbers = list(map(int, input().split()))



curr_min = numbers[0]

count = 0

for num in numbers:

    if num <= curr_min:

        count += 1

        curr_min = num



print(count)
from sys import stdin


def main():
    n = int(stdin.readline().strip())
    l = list(map(int, stdin.readline().split()))
    ar = [-1 for _ in range(n)]
    ar[0] = l[0]
    ans = 1
    for i in range(1, n):
        if l[i] <= ar[i - 1]:
            ans += 1
            ar[i] = l[i]
        else:
            ar[i] = ar[i - 1]
    print(ans)


main()

_ = int(eval(input()))
numbers = list(map(int, input().split()))
curr_min = numbers[0]
count = 0
for num in numbers:
    if num <= curr_min:
        count += 1
        curr_min = num
print(count)

-from sys import stdin - - -def main(): -    n = int(stdin.readline().strip()) -    l = list(map(int, stdin.readline().split())) -    ar = [-1 for _ in range(n)] -    ar[0] = l[0] -    ans = 1 -    for i in range(1, n): -        if l[i] <= ar[i - 1]: -            ans += 1 -            ar[i] = l[i] -        else: -            ar[i] = ar[i - 1] -    print(ans) - - -main() +_ = int(eval(input())) +numbers = list(map(int, input().split())) +curr_min = numbers[0] +count = 0 +for num in numbers: +    if num <= curr_min: +        count += 1 +        curr_min = num +print(count)