Problem:
 Score : 300 points    Problem Statement  Given is a permutation P_1, \ldots, P_N of 1, \ldots, N .
Find the number of integers i  (1 \leq i \leq N) that satisfy the following condition:   For any integer j  (1 \leq j \leq i) , P_i \leq P_j .       Constraints   1 \leq N \leq 2 \times 10^5  P_1, \ldots, P_N is a permutation of 1, \ldots, N .  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  P_1  ...  P_N       Output  Print the number of integers i that satisfy the condition.        Sample Input 1 5
4 2 5 1 3      Sample Output 1 3  i=1 , 2 , and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1 . Similarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.       Sample Input 2 4
4 3 2 1      Sample Output 2 4  All integers i  (1 \leq i \leq N) satisfy the condition.       Sample Input 3 6
1 2 3 4 5 6      Sample Output 3 1  Only i=1 satisfies the condition.       Sample Input 4 8
5 7 4 2 6 8 1 3      Sample Output 4 4       Sample Input 5 1
1      Sample Output 5 1

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

m = 10 ** 6
ans = 0

for i in range(n) :
    if p[i] < m :
        m = p[i]
        ans += 1

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

ans = 1
m = p[0]
p = p[1:]
for e in p:
  if e < m:
    ans += 1
  m = min(m, e)

print(ans)

Solution (Python):
import math,sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili=lambda:list(map(int,sys.stdin.readlines()))
li = lambda:list(map(int,input().split()))

I=lambda:int(input())
S=lambda:input().strip()
mod = 1000000007

n=I()
a=li()
m=1000000
c=0
for i in range(n):
    if(a[i]<m):
        c+=1
        m=a[i]
print(c)

Solution (Python):
n = int(input())
p = input().split(" ")
for i in range(n):
	p[i] = int(p[i])
ans = 0
m = p[0] 
for i in range(n):
	if m >= p[i]:
		ans += 1
		m = p[i]
print(ans)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
P = [int(x) for x in stdin.readline().rstrip().split()]
mi = P[0]
ma = P[0]
ans = 0
for i in range(N):
    if P[i] <= mi:
        ans += 1
    ma = max(ma,P[i])
    mi = min(mi,P[i])
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

amin = N
ans = 0

for i in range(N):
    if A[i] <= amin:
        ans += 1
        amin = A[i]

print(ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))

temp_min = int(10**6)
ans = 0
for i in p:
    if i < temp_min:
        temp_min = i
        ans += 1




print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
ans = 1
cur = p[0]
for i in range(1, n):
    if p[i] <= cur:
        cur = p[i]
        ans += 1
print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

ans = 200000
count = 0

for i in range(n):

    if p[i] <= ans:
        count += 1
        ans = p[i]

print(count)

Solution (Python):
n = int(input())
arr = list(map(int,input().split()))

count = 0
num = n+1
for i in range(n):
  if num > arr[i]:
    count += 1
  num = min(num,arr[i])
  if num == 1:
    break

print(count)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 

N=int(input())
p=list(map(int,input().split()))
cnt=0

m=10**6
for k in range(N):
	m=min(m,p[k])
	if m==p[k]:
		cnt+=1

print(cnt)

Solution (Python):
n = int(input())
lis = list(map(int, input().split()))
ans = 0
minl = lis[0]
for i in lis:
    if minl >= i:
        minl = i
        ans += 1
print(ans)

Solution (Python):
n = int(input().strip())
ps = [int(s) for s in input().strip().split()]

minval = float("inf")
result = 0
for p in ps:
    if p <= minval:
        result += 1
    minval = min(minval, p)
print(result)

Solution (Python):
n = int(input())
ls = list(map(int, input().split()))

mn = ls[0]
cnt = 1

for i in range(1, n):
    if mn != min(mn, ls[i]):
        cnt += 1
        mn = ls[i]

print(cnt)

Solution (Python):
n = int(input())

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

ans = 0

prev_min = p[0]

for i in p:
    if prev_min >= i:
        ans += 1
        prev_min = i


print(ans)

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N = int(input())
    P = list(iim())
    m = P[0]
    i = 0
    for pi in P:
        if pi > m:
            continue
        m = pi
        i += 1
    print(i)

if __name__ == "__main__":
    resolve()

Solution (Python):
N = int(input())
P = list(map(int,input().split()))

ans = 0
m_n = N
for i in range(N):
  if m_n >= P[i]:ans += 1
  m_n = min(m_n,P[i])
print (ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

ans = 0
m = 10**9
for i in range(n):
  if m > p[i]:
    ans += 1
    m = p[i]
  else:
    continue
print(ans)

Solution (Python):
n = int(input())
p_list = list(map(int, input().split()))
min_num = p_list[0]
ans = 1

for i in range(1, n):
    if p_list[i] <= min_num:
        ans += 1
    min_num = min(min_num, p_list[i])

print(ans)

Solution (Python):
n = int(input())
p = map(int, input().split(' '))

cnt = 0
current = None

for i in p:
    if current is None or current >= i:
        cnt += 1
        current = i

print(cnt)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
cnt=1
a=p[0]
for i in range(1,n):
    if p[i] <= a:
        a = p[i]
        cnt += 1
print(cnt)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    P = [int(x) for x in input().split()]


    ans = 1
    mi = P[0]
    for i in range(1, N):
        if mi >= P[i]:
            ans += 1
        mi = min(mi, P[i])


    print(ans)



    
    

if __name__ == '__main__':
    main()

Solution (Python):
N= int(input())
x = list(map(int, input().split()))
min=100000000
count=0

for i in range(N):
    if x[i]<=min:
        count=count+1
        min=x[i]
print(count)

Solution (Python):
N = int(input())
p = list(map(int, input().split()))
m = N+1
ans = 0
for i in range(N):
  if p[i] < m:
    m = p[i]
    ans += 1
print(ans)

Solution (Python):
n=int(input())
a=[int(x) for x in input().split()]

c=1
mi=a[0]
for i in range(1,n):
        mi=min(mi,a[i-1])
        if(mi>a[i]):
                c+=1
print(c)

Solution (Python):
n=int(input())

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

m=2*10**5+1

ans=0

for i in range(n):
    if p[i]<m:
        ans+=1
        m=p[i]

print(ans)

Solution (Python):

N = int(input())
P = list(map(int, input().split()))
L = [P[0]]
ans = 0
for i in range(1, N):
    if L[-1] == P[i]:
        ans += 1
    L.append(min(L[-1], P[i]))
print(len(set(L)) + ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_num = int(1e10)
for i in range(n):
    if min_num > p[i]:
        min_num = p[i]
        ans += 1
print(ans)

Solution (Python):
n = int(input())
itr = map(int, input().split())
mn = int(next(itr))
ans = 1

for p in itr:
    if p <= mn:
        ans += 1
        mn = p

print(ans)

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
minnum=A[0]
sol=[]
for i in range(N):
   if A[i]<=minnum:
      sol.append(A[i])
      minnum=A[i]
print(len(sol))

Solution (Python):
N= int(input())
P = list(map(int, input().split()))

ans = 0
min_ = P[0]
for p in P:
  if min_ >= p:
    min_ = p
    ans +=1
print(ans)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))

min = P[0]

ans = 0

for i in range(N):
    if min >= P[i]:
        ans+=1
        min = P[i]

print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

min_value = P[0]
count = 0
for i in range(N):
    if P[i] <= min_value:
        min_value = P[i]
        count += 1

print(count)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
P_min = N
cnt = 0
for i in P:
    if P_min >= i:
        cnt += 1
    P_min = min(i,P_min)
print(cnt)

Solution (Python):
N = int(input())
Pn = list(map(int, input().split()))

ans = 1
mi = Pn[0]
for i in range(1, N):
    mi = min(mi, Pn[i])
    if Pn[i] == mi:
        ans += 1

print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
vmin = A[0]
ans = 1

for i in range(1, N):
    if vmin > A[i]:
        ans += 1
        vmin = A[i]

print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

max_lst = [2 * 10 ** 6 for i in range(N + 1)]
ctr = 0

for i in range(1, N + 1):
	max_lst[i] = min(max_lst[i - 1], P[i - 1])

for i in range(N):
	if max_lst[i] >= P[i]:
		ctr += 1
print(ctr)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
PP = []
mini = N+1
ans = 0
for i in range(N):
    mini = min(mini,P[i])
    PP.append(mini)
    if P[i] <= PP[i]:ans += 1
print(ans)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
m=p[0]
cnt=0
for i in range(n):
  if p[i]<=m:
    cnt+=1
    m=p[i]
  else:
    continue

print(cnt)

Solution (Python):
n = int(input())
P = list(map(int, input().split()))

min_n = float('inf')
counter = 0

for i in range(n):
  if P[i] <= min_n:
    counter += 1
    min_n = P[i]
    
print(counter)

Solution (Python):
import sys
input = sys.stdin.readline
N= int(input())
li_P = list(map(int, input().split()))
min = li_P[0]
count = 0
for p in li_P:
    if p <= min:
        count += 1
        min = p
print(count)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))

count=0
min=p[0]
for i in p:
    if i>min:
        pass
    else:
        min=i
        count+=1
print(count)

Solution (Python):
n=int(input())
 
P=list(map(int,input().split()))
 
min=P[0]
count=0
for i in P:
    if min>=i:
        count+=1
        min=i
print(count)

Solution (Python):
N  = int(input())
P = list(map(int, input().split()))
MIN = 2*(10**5)
ans = 0

for p in P:
    if MIN >= p:
        ans += 1
        MIN = p

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

min_val = 200001
sum = 0
for i in range(n):
	if p[i] <= min_val:
		sum += 1
		min_val = p[i]

print(sum)

Solution (Python):
import sys


def solve(inp):
    N = int(inp.readline().strip())
    P = list(map(int, inp.readline().strip().split(' ')))

    r = 0
    minp = P[0]
    for p in P:
        if minp >= p:
            r += 1
            minp = p

    return str(r)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

N = int(input())
P = np.array(input().split(), dtype=int)
Q = P.copy()

for i in range(1,N):
  Q[i] = min(Q[i-1], Q[i])

print(np.sum(P==Q))

Solution (Python):
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]



def A():
    n, m = LI()
    if n == m:
        print("Yes")
    else:
        print("No")

    return



def B():
    a, b = LI()
    if a <= b:
        ans = str(a) * b
    else:
        ans = str(b) * a
    print(ans)
    return



def C():
    n = I()
    p = LI()
    n_min = n + 1
    ans = 0
    for num in p:
        if num < n_min:
            ans += 1
            n_min = num
    print(ans)
    return



def D():
    return



def E():
    return



def F():
    return



if __name__ == "__main__":
    C()

Solution (Python):
from collections import defaultdict

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

m = float('inf')
ret = 0
for i, p in enumerate(P) :
  if p < m  :
    ret += 1
    m = p
    
print(ret)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

cnt = 1
min = P[0]

for i in range(1, len(P)):
    if P[i] < min:
        cnt += 1
        min = P[i]

print(cnt)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
m = 1e10
ans = 0
for i in range(n):
    if p[i] <= m:
        ans += 1
    m = min(m, p[i])

print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

rui = [None] * (N)
rui[0] = P[0]


for i in range(1, N):
    a = rui[i-1]
    b = P[i]
    rui[i] = min(a, b)


c = 0
for i in range(N):
    if P[i] <= rui[i]:
        c += 1
print(c)

Solution (Python):
N = int(input())
import numpy as np
P = np.array(list(map(int,input().split())))
ans = 1
min_p = P[0]
for p in P[1::]:
  if min_p>=p:
    ans+=1
  min_p=min(p,min_p)
    
print(ans)

Solution (Python):
N = int(input())
p_list = list(map(int,input().split()))

min_num = 1000000000
count = 0
for p in p_list:
  if min_num >= p:
    count += 1
    min_num = p
print(count)

Solution (Python):
def main():
    N = int(input())
    p = [int(i) for i in input().split()]

    min_ = 2 * 10**6
    ans = 0
    for i in range(N):
        if p[i] < min_:
            min_ = p[i]
            ans += 1

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
min=p[0]
ans=1
for i in range(1,n):
    if min>=p[i]:
        ans+=1
        min=p[i]
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

mn = 10 ** 10
cnt = 0
for i in a:
    mn = min(mn, i)
    if mn >= i:
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
max = 10**6
count = 0
for i in range(n):
    if max >= p[i]:
        count += 1
        max = p[i]
print(count)

Solution (Python):
N = int(input())
P = list(map(int, input().split(' ')))

min_val = P[0]
cnt = 1
for i in range(1, len(P)):
    if P[i] <= min_val:
        min_val = P[i]
        cnt += 1
print(cnt)

Solution (Python):
def main():
    N = int(input())
    PN = map(int, input().split())

    ans = 0
    min_p = 999999999999
    for P in PN:
        if P <= min_p:
            min_p = P
            ans += 1

    print(ans)


main()

Solution (Python):



N = int(input())
P = list(map(int, input().split()))

idxs = [0] * (N+1)
for i in range(N):
    idxs[P[i]] = i

ans = 0
last = N+10
for i in range(1,N+1):
    if idxs[i] < last:
        ans += 1
        last = idxs[i]
    else:
        continue

print(ans)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]

m = 2 * (10**5) + 1
c = 0
for i in p:
    if m > i:
        c += 1
    m = min(m, i)
print(c)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
INF = N+1

ans = 0
max_num = INF
for i in P:
    if i<=max_num:
        ans += 1
        max_num = i
print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
m_list = [0]*N
m_list[0] = P[0]
res = 1

for i in range(1, N):
  m_list[i] = min(m_list[i-1], P[i])
  if m_list[i] == P[i]:
    res += 1
  
print(res)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
k=p[0]
ans=1
for i in range(1,n):
    if p[i]<k:
        ans+=1
        k=p[i]
print(ans)

Solution (Python):

N = int(input())
L = list(map(int,input().split()))
mini = L[0]
n = 1
if N > 1:
    for i in range(N-1):
        if mini > L[i+1]:
            n = n+1
            mini = L[i+1]
print(n)

Solution (Python):
'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''
'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''
'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  
print(list(set(a) & set(b)))  
'''
'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''
'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''
'''
リスト同士の演算
list(map(lambda x, y: x+y, el2, el3))
'''
'''
配列の初期化
配列名=[a]*n+[b]*m
'''
'''
重複
list(set())
２次元配列
list(map(list, set(map(tuple, addition))))
'''
'''
順列
for el in itertools.permutations(配列のパターン):
'''
'''
Decimal()
'''






from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
import itertools
from functools import reduce
from operator import mul
def gcd(*numbers):
    return reduce(math.gcd, numbers)


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]


N = int(stdin.readline().rstrip())
P = [int(s) for s in stdin.readline().rstrip().split()]
count = 1
min = P[0]
for k in range(len(P)):
    if k == 0:
        continue
    if min > P[k]:
        count += 1
        min = P[k]
print(count)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
tmp = p[0]
ans = 0

for i in p:
    if i <= tmp:
        ans  += 1
        tmp = i

print(ans)

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret



N = read_a_int()
P = read_ints()











ans = 0
MIN = P[0]
for p in P:
    if MIN >= p:
        MIN = p
        ans += 1

print(ans)

Solution (Python):
n = int(input())
p_list = list(map(int, input().split(" ")))
count = 0
minimum = 10000000
for i in p_list:
    if(i <= minimum):
        minimum = i
        count += 1
print(count)

Solution (Python):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines








def main():
	n=int(input())
	P=list(map(int,input().split()))
	
	a=P[0]
	
	ans=0
	
	for i in P:
		if i<=a:
			ans+=1
			a=i
	
	print(ans)
	
	
	
	
	


if __name__ == "__main__":
	main()

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, P):
    m = INF
    ans = 0
    for i in range(N):
        if P[i] <= m:
            ans += 1
        m = min(m, P[i])
    return ans


def main():
    N = read_int()
    P = read_int_n()
    print(slv(N, P))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
min_value = 10**6
total = 0
for i in p:
    min_value = min(min_value, i)
    if min_value >= i:
        total += 1
print(total)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
ans = 1
MIN = p[0]
for i in range(1, n):
   if MIN > p[i]:
      ans += 1
      MIN = p[i]
print(ans)

Solution (Python):




import sys
input = sys.stdin.readline



def main():
    N = int(input())
    P = list(map(int,input().split()))

    least = 2 * 10 ** 5 + 1
    res = 0

    for i in range(N):
        if least >= P[i]:
            res += 1
        least = min(least,P[i])

    print(res)



main()

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

mx = 10**8
ans = 0
for i in range(N):
    if P[i] <= mx:
        ans += 1
    mx = min(mx, P[i])

print(ans)

Solution (Python):

import sys
input = sys.stdin.readline

a = int(input())
b = list(map(int,input().split()))
inf=float("inf")
b_min = [inf for _ in range(a)]
b_min[0] = b[0]
for i in range(1,a):
    b_min[i] = min(b_min[i-1],b[i])
ret = 0
for i,j in zip(b,b_min):
    if i == j:
        ret+=1
print(ret)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

b=[0]*n
mini=float('inf')
cnt=0
for i in range(n):
    mini=min(mini,a[i])
    b[i]=mini
    if a[i]==b[i]:
        cnt+=1
print(cnt)

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
point = 0
mi = 10**10
for i in range(n):
    mi = min(li[i],mi)
    if li[i] <=  mi:
        point += 1
print(point)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))

ans = 0
cur = 0
for i in range(N):
    if i == 0:
        ans += 1
        cur = P[i]
    elif cur >= P[i]:
        ans += 1
        cur = P[i]
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
P = [int(x) for x in input().split()]
cnt = 1
minP = P[0]
for i in range(1, N):
    if minP >= P[i]:
        cnt += 1
        minP = P[i]

print(cnt)

Solution (Python):
n=int(input())
A=map(int,input().split())
num=99999999999999999999
count=0
for i in A:
    if i<num:
        count+=1
        
    num=min(num,i)
print(count)

Solution (Python):
N = int(input())
Pl = list(map(int,input().split()))

tmpmin = N+1
ans = 0

for p in Pl:
    if(p<tmpmin):
        ans += 1
        tmpmin = p

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

cnt = 0
m = float('inf')
for i in range(n):
    if m > p[i]:
        cnt += 1
        m = p[i]

print(cnt)

Solution (Python):
n = int(input())
p = list(map(int , input().split()))

ans = 1
min = p[0]
for i in range(1, n):
    if  p[i] < min:
        ans += 1
        min = p[i]
print(ans)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]

ans = 1

min_num = p[0]

for i in range(1,n):
    if min_num > p[i]:
        min_num = p[i]
        ans += 1
        
print(ans)

Solution (Python):
n = int(input())
p_array = [int(x) for x in input().split()]
now = float("inf")
cnt = 0
for p in p_array:
    if now > p:
        now = p
        cnt += 1
print(cnt)

Solution (Python):
N=int(input())
P=list(map(int,input().split(' ')))
tmp = P[0]
ans = 0
for i in P:
    if tmp >= i:
        ans += 1
        tmp = i
print(ans)

Solution (Python):
N=int(input())
li = list(map(int,input().split()))	
mini = li[0]
count = 0
for num in li:
    if mini >= num:
        count += 1
        mini = num
print(count)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
mi=n+3
cn=n
for i in range(n):
    if p[i]<mi:
        mi=p[i]
    if p[i]>mi:
        cn-=1
print(cn)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
Ans = 0
Min = 9999999

for i in range(N):
  if P[i] <= Min:
    Ans = Ans + 1
    Min = P[i]

print(Ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
minn = n+1
ans = 0
for i in range(n):
	if(a[i] < minn):
		ans += 1
		minn = a[i]
print(ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))






Pi_min = p[0]
ans = 0
for i in p:
    if i <= Pi_min:
        ans = ans + 1
    Pi_min = min(Pi_min,i)

print(ans)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
curmin = float('inf')
ans = 0
for p in P:
    if p <= curmin:
        ans += 1
        curmin = p
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
l = [A[0]]
for i in range(1, N):
  if A[i] <= l[-1]:
    l.append(A[i])
print(len(l))

Solution (Python):
N, *P = map(int, open(0).read().split())

min_v = 10 ** 6
max_v = 0
ans = 0
for i in range(N):
    if P[i] < min_v:
        ans += 1
        min_v = P[i]
    elif P[i] > max_v:
        max_v = P[i]
        
print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))

minimun = P[0]
res = 0
for p in P:
    if p <= minimun:
        res += 1
        minimun = p

print(res)

Solution (Python):
N=int(input())
P=list(map(int, input().split()))

count=1
min=P[0]
for i in range(1, N):
    if P[i]<=min:
        count += 1
        min = P[i]
print(count)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]
ans = n
tmp = p[0]
for i in range(n):
    if p[i] <= tmp:
        tmp = p[i]
    else:
        ans -= 1
print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
m = n + 1
for i in range(n):
    if m > p[i]:
        cnt += 1
        m = p[i]
print(cnt)

Solution (Python):

import sys
from fractions import gcd
from string import ascii_uppercase as ABC

def inpl(): return list(map(int, input().split()))

N = int(input())
min_ = 10**9
P = inpl()
ans = 0
for i in range(N):
    if min_ > P[i]:
        ans += 1
    min_ = min(min_, P[i])
print(ans)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
answer=0
min_num=p[0]
for i in range(n):
    if p[i]<=min_num:
        answer+=1
        min_num=p[i]
print(answer)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= min(m, p[i-1]):
        cnt += 1
        m = p[i]
print(cnt)

Solution (Python):
def read():
    N = int(input().strip())
    P = list(map(int, input().strip().split()))
    return N, P

def solve(N, P):
    min_value = P[0]
    count = 0
    for i in range(N):
        min_value = min(min_value, P[i])
        if P[i] == min_value:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

Solution (Python):
n = int(input())
li =list(map(int,input().split()))
m =li[0]
ans = 0
for x in li:
  if x<= m:
    ans+=1
    m = x
print(ans)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]
ans = 1
smallest = p[0]
for i in range(1,n):
    if p[i] < smallest:
        smallest = p[i]
        ans += 1
print(ans)

Solution (Python):
n = int(input())
p  = list(map(int,input().split()))
x = 1
mn = p[0]
for i in range(1,len(p)):
  if p[i] <= mn:
    x += 1
    mn = p[i]
print(x)

Solution (Python):
import sys
input = sys.stdin.readline

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

ans = 1
_min = p[0]

for i in p[1:]:
    if i <= _min:
        ans += 1
        _min = i

print(ans)

Solution (Python):
import math
import calendar
import fractions
import itertools

n = int(input())
p = list(map(int, input().split()))

pmax = []

minimum = p[0]

for i in p:
    minimum = min(minimum, i)
    pmax.append(minimum)

ans = 0
for i in range(len(pmax)):
    if p[i] <= pmax[i]:
        ans += 1
print(ans)

Solution (Python):
N = int(input())
PList = list(map(int, input().split()))

tmp = -1
count = 0
for i in range(0, N):
    if i == 0:
        tmp = PList[i]
        count += 1
    elif tmp > PList[i]:
        tmp = PList[i]
        count += 1
        
print(count)

Solution (Python):


n=int(input())
p=list(map(int,input().split()))
mi=10**9
ma=0
ans=0
for i in range(n):
    
    if mi>p[i]:
        mi=p[i]
        ans+=1
    if ma<p[i] and i!=0:
        ma=p[i]
        continue
print(ans)

Solution (Python):
n = int(input())
lp = list(map(int, input().split()))

m = lp[0]
ans = 0

for i in range(n):
    if lp[i] <= m:
        ans += 1

    m = min(lp[i], m)

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
min = float('inf')
cnt = 0
for i in range(n):
    if min >= p[i]:
        cnt += 1
        min = p[i]
print(cnt)

Solution (Python):


N = int(input())
P = list(map(int, input().split()))

mini = N + 1
cnt = 0
for p in P:
    if p <= mini:
        mini = p
        cnt += 1

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    
    N = [int(x) for x in sys.stdin.readline().split()][0]  
    p_list = [int(x) for x in sys.stdin.readline().split()]  
    
    
    

    logger.debug('{}'.format([N, p_list]))

    ans = 0
    _min = 2 * 10**5 + 1
    for p in p_list:
        if p <= _min:
            ans += 1
            _min = p
    print(ans)


if __name__ == "__main__":
    resolve()





import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5
4 2 5 1 3"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """4
4 3 2 1"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """6
1 2 3 4 5 6"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """8
5 7 4 2 6 8 1 3"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """1
1"""
        output = """1"""
        self.assertIO(input, output)

Solution (Python):
def examA():
    N, M = LI()
    if N==M:
        print("Yes")
    else:
        print("No")
    return

def examB():
    A, B = LI()
    if A>B:
        ans = str(B)*A
    else:
        ans = str(A)*B
    print(ans)
    return

def examC():
    N = I()
    P = LI()
    minP = N+1
    ans = 0
    for i in range(N):
        if minP>P[i]:
            minP=P[i]
            ans +=1
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examC()

"""

"""

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

m = n + 1
ans = 0

for i in range(n):
    if p[i] <= m:
        ans += 1
        m = p[i]

print(ans)

Solution (Python):
n = int(input())
lis = list(map(int, input().split()))
cur = 10**7
ans = 0
for item in lis:
  if cur >= item:
    cur = item
    ans += 1
print(ans)

Solution (Python):
a = int(input())
b = list(map(int,input().split()))
ans = 0
g = a+1
for c in b:
  if c < g:
    ans += 1
    g = c
print(ans)