n = int(eval(input()))

p = [int(i) for i in input().split()]



p_min = [p[0],] * n



for i in range(1,n):

    if p_min[i-1] > p[i]:

        p_min[i] = p[i]

    else:

        p_min[i] = p_min[i-1]



print((sum([1 for i in range(n) if p_min[i] >= p[i]])))
import sys



readline = sys.stdin.readline

MOD = 10 ** 9 + 7

INF = float('INF')

sys.setrecursionlimit(10 ** 5)





def main():

    N = int(readline())

    P = list(map(int, readline().split()))

    cur = N + 1

    ans = 0

    for x in P:

        if cur > x:

            ans += 1

            cur = x



    print(ans)



if __name__ == '__main__':

    main()

n = int(eval(input()))
p = [int(i) for i in input().split()]
p_min = [
    p[0],
] * n
for i in range(1, n):
    if p_min[i - 1] > p[i]:
        p_min[i] = p[i]
    else:
        p_min[i] = p_min[i - 1]
print((sum([1 for i in range(n) if p_min[i] >= p[i]])))

import sys

readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)


def main():
    N = int(readline())
    P = list(map(int, readline().split()))
    cur = N + 1
    ans = 0
    for x in P:
        if cur > x:
            ans += 1
            cur = x
    print(ans)


if __name__ == "__main__":
    main()

-n = int(eval(input())) -p = [int(i) for i in input().split()] -p_min = [ -    p[0], -] * n -for i in range(1, n): -    if p_min[i - 1] > p[i]: -        p_min[i] = p[i] -    else: -        p_min[i] = p_min[i - 1] -print((sum([1 for i in range(n) if p_min[i] >= p[i]]))) +import sys + +readline = sys.stdin.readline +MOD = 10**9 + 7 +INF = float("INF") +sys.setrecursionlimit(10**5) + + +def main(): +    N = int(readline()) +    P = list(map(int, readline().split())) +    cur = N + 1 +    ans = 0 +    for x in P: +        if cur > x: +            ans += 1 +            cur = x +    print(ans) + + +if __name__ == "__main__": +    main()