# Binary Indexed Tree (Fenwick Tree)

class BIT:

    def __init__(self, n):

        self.n = n

        self.data = [0]*(n+1)

        self.el = [0]*(n+1)

    def sum(self, i):

        s = 0

        while i > 0:

            s += self.data[i]

            i -= i & -i

        return s

    def add(self, i, x):

        # assert i > 0

        self.el[i] += x

        while i <= self.n:

            self.data[i] += x

            i += i & -i

    def get(self, i, j=None):

        if j is None:

            return self.el[i]

        return self.sum(j) - self.sum(i)



N = int(eval(input()))

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



res = 0

bit = BIT(200010)

for i, p in enumerate(P):

    bit.add(p, 1)

    res += 1 if bit.sum(p) <= 1 else 0

    # print(bit.sum(p))



print(res)

# # Binary Indexed Tree (Fenwick Tree)

# class BIT:

#     def __init__(self, n):

#         self.n = n

#         self.data = [0]*(n+1)

#         self.el = [0]*(n+1)

#     def sum(self, i):

#         s = 0

#         while i > 0:

#             s += self.data[i]

#             i -= i & -i

#         return s

#     def add(self, i, x):

#         # assert i > 0

#         self.el[i] += x

#         while i <= self.n:

#             self.data[i] += x

#             i += i & -i

#     def get(self, i, j=None):

#         if j is None:

#             return self.el[i]

#         return self.sum(j) - self.sum(i)



# N = int(input())

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



# res = 0

# bit = BIT(200010)

# for i, p in enumerate(P):

#     bit.add(p, 1)

#     res += 1 if bit.sum(p) <= 1 else 0

#     # print(bit.sum(p))



# print(res)

INF = 10**18



N = int(eval(input()))

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



minp = INF

res = 0

for p in P:

    if p < minp:

        minp = p

        res += 1

print(res)
# Binary Indexed Tree (Fenwick Tree)
class BIT:
    def __init__(self, n):
        self.n = n
        self.data = [0] * (n + 1)
        self.el = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s

    def add(self, i, x):
        # assert i > 0
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i

    def get(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)


N = int(eval(input()))
P = [int(i) for i in input().split()]
res = 0
bit = BIT(200010)
for i, p in enumerate(P):
    bit.add(p, 1)
    res += 1 if bit.sum(p) <= 1 else 0
    # print(bit.sum(p))
print(res)

# # Binary Indexed Tree (Fenwick Tree)
# class BIT:
#     def __init__(self, n):
#         self.n = n
#         self.data = [0]*(n+1)
#         self.el = [0]*(n+1)
#     def sum(self, i):
#         s = 0
#         while i > 0:
#             s += self.data[i]
#             i -= i & -i
#         return s
#     def add(self, i, x):
#         # assert i > 0
#         self.el[i] += x
#         while i <= self.n:
#             self.data[i] += x
#             i += i & -i
#     def get(self, i, j=None):
#         if j is None:
#             return self.el[i]
#         return self.sum(j) - self.sum(i)
# N = int(input())
# P = [int(i) for i in input().split()]
# res = 0
# bit = BIT(200010)
# for i, p in enumerate(P):
#     bit.add(p, 1)
#     res += 1 if bit.sum(p) <= 1 else 0
#     # print(bit.sum(p))
# print(res)
INF = 10**18
N = int(eval(input()))
P = [int(i) for i in input().split()]
minp = INF
res = 0
for p in P:
    if p < minp:
        minp = p
        res += 1
print(res)

-# Binary Indexed Tree (Fenwick Tree) -class BIT: -    def __init__(self, n): -        self.n = n -        self.data = [0] * (n + 1) -        self.el = [0] * (n + 1) - -    def sum(self, i): -        s = 0 -        while i > 0: -            s += self.data[i] -            i -= i & -i -        return s - -    def add(self, i, x): -        # assert i > 0 -        self.el[i] += x -        while i <= self.n: -            self.data[i] += x -            i += i & -i - -    def get(self, i, j=None): -        if j is None: -            return self.el[i] -        return self.sum(j) - self.sum(i) - - +# # Binary Indexed Tree (Fenwick Tree) +# class BIT: +#     def __init__(self, n): +#         self.n = n +#         self.data = [0]*(n+1) +#         self.el = [0]*(n+1) +#     def sum(self, i): +#         s = 0 +#         while i > 0: +#             s += self.data[i] +#             i -= i & -i +#         return s +#     def add(self, i, x): +#         # assert i > 0 +#         self.el[i] += x +#         while i <= self.n: +#             self.data[i] += x +#             i += i & -i +#     def get(self, i, j=None): +#         if j is None: +#             return self.el[i] +#         return self.sum(j) - self.sum(i) +# N = int(input()) +# P = [int(i) for i in input().split()] +# res = 0 +# bit = BIT(200010) +# for i, p in enumerate(P): +#     bit.add(p, 1) +#     res += 1 if bit.sum(p) <= 1 else 0 +#     # print(bit.sum(p)) +# print(res) +INF = 10**18 +minp = INF -bit = BIT(200010) -for i, p in enumerate(P): -    bit.add(p, 1) -    res += 1 if bit.sum(p) <= 1 else 0 -    # print(bit.sum(p)) +for p in P: +    if p < minp: +        minp = p +        res += 1