CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

ans = 0

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



# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))

ans = 0

c = p[0]

for i in range(n):
    #a = p[:i + 1]

    if c >= p[i]:
        c = p[i]
    if c >= p[i]:
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
count = 0
for i in range(len(p)):
    tmp = p[i]
    a = min(p[:i+1])
    if tmp == a:
        count+=1
print(count)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
count = 1
tmp = p[0]
for i in p:
    a = min(tmp, i)
    if tmp != a:
        count+=1
        tmp = a
print(count)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
c=0
for i in range(n):
    if p[i]==min(p[:i+1]):
        c+=1
print(c)

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
c=0
m=n+1
for i in p:
    if i<m:
        m=i
        c+=1
print(c)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
ans = 0
for i in range(n):
    if min(p[:i + 1]) == p[i]:
        ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
mnm = 2 * 10**5
ans = 0
for i in p:
    if i <= mnm:
        mnm = i
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
l = list(map(int, input().split()))

total = 0

for i in range(n):
    count = 0
    for j in range(i + 1):
        if l[i] <= l[j]:
            count += 1
    if count == i + 1:
        total += 1

print(total)

# Optimized solution
n = int(eval(input()))
l = list(map(int, input().split()))

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)
# Original solution
def search(ind):
    for i in range(ind):
        if p_ls[i] < p_ls[ind]:
            return 0
    return 1

n = int(eval(input()))
p_ls = list(map(int, input().split()))
sub_cnt = 0
one = p_ls.index(1)+1
for i in range(one):
    sub_cnt += search(i)
print(sub_cnt)


# Optimized solution
n = int(eval(input()))
p_ls = list(map(int, input().split()))
mini = p_ls[0]
cnt = 0
for i in range(n):
    if mini >= p_ls[i]:
        cnt+=1
        mini= p_ls[i]
print(cnt)
# Original solution
n = int(eval(input()))
p_list = list(map(int, input().split()))

cnt = 0
for i in range(n):
    if p_list[i] == min(p_list[:i+1]):
        cnt += 1
print(cnt)

# Optimized solution
n = int(eval(input()))
p_list = list(map(int, input().split()))

cnt = 0
minn = p_list[0]
for i in range(n):
    minn = min(p_list[i], minn)
    if p_list[i] == minn:
        cnt += 1
print(cnt)
# Original solution
n=int(eval(input()))
p=input().split()
num=0
for i in range(n):
    for j in range(i+1):
        if int(p[j])<int(p[i]):
            break
        if j==i:
            num+=1
print(num)


# Optimized solution
n=int(eval(input()))
p=input().split()
num=0
mini=int(p[0])
for i in range(n):
    if int(p[i])<=mini:
        num+=1
        mini=int(p[i])
print(num)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))

last_ok_postion = 0 
last_ok_value = P[0]
count = 1

for i in range(1,N):
    if last_ok_value >= P[i]:
        m = min(P[last_ok_postion:i])
        if m >= P[i]:
            count += 1
print(count)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))

last_ok_postion = 0 
count = 1

for i in range(1,N):
    if P[last_ok_postion] >= P[i]:
        m = min(P[last_ok_postion:i])
        if m >= P[i]:
            count += 1
            last_ok_postion = i
print(count)
# Original solution
N = int(eval(input()))
P = [int(p) for p in input().split()]
ans = 0

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

print(ans)

# Optimized solution
N = int(eval(input()))
P = [int(p) for p in input().split()]
ans = 0
mi = P[0]
for i in range(N):
  mi = min(mi, P[i])
  if mi >= P[i]:
    ans += 1 
print(ans)
# Original solution
import sys
input = sys.stdin.readline

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

ans = 0

for i in range(0, len(P)-1):
    if (P[1] <= P[0]):
        ans += 1
        del(P[0])
    else:
        del(P[1])

print((ans+1))


# Optimized solution
import sys
input = sys.stdin.readline

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

ans = 0
pivot = P[0]

for i in range(0, len(P)):
    if (pivot >= P[i]):
        ans += 1
        pivot = P[i]

print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
ans = 0
for i, pi in enumerate(P):
    if all([pi < pj for pj in P[:i]]):
        ans += 1
print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))
pp = P[0]
ans = 0
for p in P:
    if p <= pp:
        ans += 1
        pp = p
print(ans)
# Original solution
dummy = list(map(int, input().split(" ")))
N = dummy[0]

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

out = 0
for a in range(N):
    flag = 1
    for b in range(a + 1):
        #print(P[a], P[b])
        if(P[a] > P[b]):
            flag = 0
            break
    if(flag == 1):
        out += 1

#print(P)
print(out)

# Optimized solution
dummy = list(map(int, input().split(" ")))
N = dummy[0]

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

out = 0
min = N + 1
for a in range(N):
    if(P[a] <= min):
        min = P[a]
        out += 1

#print(P)
print(out)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
cnt = 0
for i in range(N):
    part_min = min(P[:i+1])
    if(part_min == P[i]):
        cnt += 1

print(cnt)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
cnt = 0
min1 = P[0]
for i in range(N):
    if(min1 > P[i]):
        min1 = P[i]
    if(min1 == P[i]):
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
x = P.pop(0)
m = x
ans = 1
for i in range(N-1):
    x = P.pop(0)
    if x <= m:
        ans += 1
        m = x
print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
x = P[0]
m = x
ans = 1
for i in range(1,N):
    x = P[i]
    if x <= m:
        ans += 1
        m = x
print(ans)
# Original solution
N = eval(input())
P_list = input().split()
# N = '5'
# P_list = '4 2 5 1 3'.split()
P_list = [int(i) for i in P_list]
length = int(N)
ans = 0 
M = []
for i in range(length):
    # print(min(P_list[0:i+1]))
    if P_list[i]==min(P_list[0:i+1]):
        ans +=1
    
print(ans)

# Optimized solution
N = eval(input())
P_list = input().split()
# N = '5'
# P_list = '4 2 5 1 3'.split()
P_list = [int(i) for i in P_list]
length = int(N)
ans = 0 
M = []
mini =-1
for i in range(length):
    # print(min(P_list[0:i+1]))
    if P_list[i] <mini or mini <0:
        mini = P_list[i]
    if mini == P_list[i]:
        ans +=1


    # if P_list[i]==min(P_list[0:i+1]):
    #     ans +=1
    
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

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

print(ans)


# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))

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

print(ans)
# Original solution
n=int(eval(input()))
num=list(map(int,input().split()))
don=[]
cnt=0
for i in num:
    flg=True
    for j in don:
        if i > j:
            flg=False
    if flg:
        don.append(i)
        cnt+=1
print(cnt)

# Optimized solution
n=int(eval(input()))
num=list(map(int,input().split()))
cnt=1
min_n=num[0]
for i in range(1,n):
    if num[i] <= min_n:
        min_n=num[i]
        cnt+=1
print(cnt)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
cnt = n

for i in range(n):
    for j in range(i+1):
        if p[i] > p[j]:
            cnt -= 1
            break
print(cnt)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
cnt = 0
minx = max(p)
for i in range(n):
    minx = min(p[i],minx)
    if minx >= p[i]:
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
ans = 0
x = 0
for i in range(N):
    for j in range(i):
        if P[i] <= P[j]:
            x += 1
    if x == i:
        ans += 1
    x = 0

print(ans)



        


# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
ans = 0
x = P[0]


for i in P:
    if i == 1:
        ans += 1
        x = 1
    else:
        if x >= i:
            ans += 1
            x = i



            
    
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))

cnt = 1
for i in range(1,n):
  if p[i] > p[i-1]:
    continue
  elif min(p[:i+1]) == p[i]:
    cnt += 1
print(cnt)

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))

min_num = 10**6
cnt = 0
for i in range(n):
  if p[i] < min_num:
    min_num = p[i]
    cnt += 1
print(cnt)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
ans = 1

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

print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
ans = 1
p_min = p[0]

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

print(ans)
# Original solution
n = int(eval(input()))

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


cnt=0
for i in range(n):
    if min(P[:i+1])==P[i]:
        cnt+=1
print(cnt)

# Optimized solution
n = int(eval(input()))

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

cnt=0
a = P[0]
for i in range(n):
    a = min(a,P[i])
    if P[i] <= min(a,P[i]):
        cnt+=1
print(cnt)
# Original solution
n = int(eval(input()))
p = [int(i) for i in input().split()]

m = []
for i in range(1,n+1):
    m.append(sorted(p[:i])[0])
    
ans = 0
for i in range(n):
    if m[i] == p[i]:
        ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)
# Original solution
N = int(eval(input()))
P = [int(i) for i in input().split()]
cnt = 0
for i in range(N):
    if min(P[:i+1]) >= P[i]:
        cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
P = [int(i) for i in input().split()]
P_min = P.copy()
for i in range(1,N):
    P_min[i] = min(P_min[i-1],P[i])
cnt = 0
for i in range(N):
    if P_min[i] >= P[i]:
        cnt += 1
print(cnt)
# Original solution
def main():
    N = int(eval(input()))
    P = list(map(int, input().split()))

    ans = 1

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

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    P = list(map(int, input().split()))

    ans = 1
    tmp = P[0]
    for i in range(1, N):
        if P[i] == 1:
            print((ans + 1))
            return

        tmp = min(tmp, P[i])
        if P[i] <= tmp:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
N=int(eval(input()))
A=list(map(int,input().split()))
L=list()
ans=0
for n in A:
  L.append(n)
  if n==min(L):
    ans+=1
print(ans)

# Optimized solution
N=int(eval(input()))
A=list(map(int,input().split()))
a=A[0]
ans=1
for n in range(1,N):
  if a>A[n]:
    ans+=1
    a=A[n]
print(ans)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
a=0

for i in range(1,n):
	if p[i] <= min(p[:i]):
		a+=1
	else:
		pass
print((a+1))

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
a=0
b=10**10
for i in range(n):
	if p[i] <= b:
		a+=1
		b=p[i]
	else:
		pass
print(a)
# Original solution
n = int(eval(input()))
P = list(map(int,input().split()))

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

# Optimized solution
n = int(eval(input()))
P = list(map(int,input().split()))

num = 2*10**5+1
ans = 0
for i in range(n):
    if P[i] <= num:
        num = P[i]
        ans += 1
        
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

ans = 0
for i in range(n):
  m = []
  for j in range(i+1):
    m.append(p[j])
  if min(m) == m[-1]:
    ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))

ans = 0
for i in p:
  if i <= p[0]:
    p[0] = i
    ans += 1
print(ans)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))

data=[n+1]
for i in range(n):
  res=min(data)
  if res>p[i]:
    data.append(p[i])
print((len(data)-1))

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))

data=n+1
ans=0
for i in range(n):
  if data>p[i]:
    data=p[i]
    ans+=1
print(ans)
# Original solution
# coding: utf-8
n = int(eval(input()))
P = [int(x) for x in input().split(" ")]

def check(i):
    flag = True
    for j in range(i):
        if P[j] < P[i-1]:
            flag = False
            break
    if flag:
        return 1
    else:
        return 0
ans = 0
for i in range(1,n+1):
    ans += check(i)
print(ans)

# Optimized solution
# coding: utf-8
n = int(eval(input()))
P = [int(x) for x in input().split(" ")]
mx = P[0]
ans = 1
for i in range(1,n):
    if mx > P[i]:
        ans += 1
        mx = P[i]
print(ans)
# Original solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

class BIT:
    """ Binary Indexed Tree """

    def __init__(self, n):
        # 0-indexed
        n += 1
        nv = 1
        while nv < n:
            nv *= 2
        self.size = nv
        self.tree = [0] * nv

    def sum(self, i):
        """ [0, i]を合計する """
        s = 0
        i += 1
        while i > 0:
            s += self.tree[i-1]
            i -= i & -i
        return s

    def add(self, i, x):
        """ 値の追加：添字i, 値x """
        i += 1
        while i <= self.size:
            self.tree[i-1] += x
            i += i & -i

    def get(self, l, r=None):
        """ 区間和の取得 [l, r) """
        # 引数が1つなら一点の値を取得
        if r is None: r = l + 1
        res = 0
        if r: res += self.sum(r-1)
        if l: res -= self.sum(l-1)
        return res

N = INT()
A = LIST()

bit = BIT(N)
ans = 0
for i in range(N):
    # 自分より左にある、自分より小さな数の個数
    if bit.sum(A[i]) == 0:
        ans += 1
    bit.add(A[i], 1)
print(ans)


# Optimized solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

ans = 0
mn = INF
for a in A:
    if a < mn:
        mn = a
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
numbers = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if min(numbers[:i+1]) >= numbers[i]:
        cnt += 1

print(cnt)
    

# Optimized solution
n = int(eval(input()))
numbers = list(map(int,input().split()))
cnt = 0
a = 2*10**5
for i in range(n):
    a = min(numbers[i],a)
    if a >= numbers[i]:
        cnt += 1

print(cnt)
# Original solution
N = int(eval(input()))
num = list(map(int,input().split()))
count = 0
for _ in range(N):
  if min(num[:_+1]) == num[_]:
    count += 1

print(count)
  

# Optimized solution
N = int(eval(input()))
num = list(map(int,input().split()))
count = 0
m = num[0]
for _ in range(N):
  if m >= num[_]:
    m = num[_]
    count += 1

print(count)
# Original solution
import sys
input = sys.stdin.readline

x = int(eval(input()))
li = list(map(int, input().split()))

a = 0 # カウントする

for i in range(len(li)):
    c = 0
    j = 0
    while i >= j:
        if li[i] <=  li[j]:
            c += 1
            if c == i+1:
                a += 1
        j+=1
print(a)

# Optimized solution

x = int(eval(input()))
li = list(map(int, input().split()))

a = 0
Min = li[0]
for i in range(len(li)):
    if li[i] <= Min:
        Min = li[i]
        a += 1
print(a)
# Original solution
import bisect
N = int(eval(input()))
P = list(map(int, input().split()))

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

# Optimized solution
import bisect
N = int(eval(input()))
P = list(map(int, input().split()))

count = 0
last_min = P[0]
for i in range(N):
    last_min = min(last_min, P[i])
    if i == 0:
        count += 1
    elif last_min == P[i]:
        count += 1
print(count)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

count = 0
pre = p[0]
for i, now in enumerate(p):
    if now <=pre:
         count+=1
    pre = min(p[:i+1])
print(count)


# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))

count = 0
pre = p[0]
for now in p:
    if now <=pre:
        count+=1
        pre = now
print(count)
# Original solution
def resolve():
    N = int(eval(input()))
    P = list(map(int, input().split()))
    ans = 1
    for i in range(1, P[0]):
        if i == min(P[:P.index(i)+1]):
            ans += 1
    print(ans)
resolve()

# Optimized solution
def resolve():
    N = int(eval(input()))
    P = list(map(int, input().split()))
    min = P[0]
    ans = 1
    for i in P:
        if i < min:
            min = i
            ans += 1
    print(ans)
resolve()
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

cnt = 0
l = []
for i in P:
	l.append(i)
	if i == min(l):
		cnt += 1
print(cnt)

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))

cnt = 0
mi = P[0]
for i in range(N):
	if P[i] <= mi:
		mi = P[i]
		cnt += 1
print(cnt)
# Original solution
#入力:N(int:整数)
def input1():
	return int(eval(input()))

#入力:N,M(int:整数)
def input2():
	return list(map(int,input().split()))

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))


N=input1()
p=input_array()
count=0
for i in range(N):
	flag=True
	for j in range(len(p[:i+1])):
		if p[i]<=p[j]:
			flag=True
		else:
			flag=False
			break
	if flag:
		count+=1
print(count)








# Optimized solution
#入力:N(int:整数)
def input1():
	return int(eval(input()))

#入力:N,M(int:整数)
def input2():
	return list(map(int,input().split()))

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))


N=input1()
p=input_array()
count=0
min_int=0
for i in range(N):
	num=p[i]
	if i==0:
		min_int=num
		count+=1
	elif num<=min_int:
		min_int=num
		count+=1
		
print(count)
# Original solution
N = int(eval(input()))
lists = list(map(int, input().split()))

count = 0
for i in range(N):
    lists_slice = lists[:i+1]
    lists_min = min(lists_slice)
    if lists_min >= lists[i]:
        count+=1

    # cnt = 0
    # for j in lists_slice:
    #     if lists_slice[i] <= j:
    #         cnt += 1
    # if cnt == i+1:
    #     count+= 1
print(count)

# Optimized solution
N = int(eval(input()))
lists = list(map(int, input().split()))

count = 0
ans = 0
for i in range(N):
    if i == 0:
        ans = lists[i]
        count += 1
    else:
        if ans >= lists[i]:
            count += 1
            ans = min(ans, lists[i])
        else:
            ans = min(ans, lists[i])


    # lists_slice = lists[:i+1]
    # lists_min = min(lists_slice)
    # if lists_min >= lists[i]:
    #     count += 1
print(count)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
Bool = [1 for i in range(n)]
for i in range(n):
    if Bool[i]:
        for j in range(0,i):
            if p[i] > p[j]:
                Bool[i] = 0
print((sum(Bool)))

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
MIN = n+1
count = 0
for i in range(n):
    if MIN > p[i]:
        count += 1
    MIN = min(MIN,p[i])
print(count)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
minp = p[0]
cnt = 0
for i in range(n):
    if p[i]<=minp:cnt+=1
    minp = min(minp,p[i])
print(cnt)

# Optimized solution
def main():
    n = int(eval(input()))
    p = list(map(int,input().split()))
    minp = p[0]
    cnt = 0
    for i in range(n):
        if p[i]<=minp:cnt+=1
        minp = min(minp,p[i])
    print(cnt)
main()
# Original solution
n = int(eval(input()))
num_list = [int(i) for i in input().split()]

k = 0
for i in range(len(num_list)):
    if i != len(num_list)-1:
        if min(num_list[:i+1]) == num_list[i]:
            k += 1
    else:
        if min(num_list) == num_list[i]:
            k += 1
    
print(k)

# Optimized solution
n = int(eval(input()))
num_list = [int(i) for i in input().split()]

k = 0
for i in range(len(num_list)):
    if i == 0:
        temp_min = num_list[i]
    else:
        temp_min = min(temp_min, num_list[i])
        
    if i != len(num_list)-1:
        if temp_min == num_list[i]:
            k += 1
    else:
        if temp_min == num_list[i]:
            k += 1
    
print(k)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
l=n
ans=0
for i in range(1,n+1):
    if p.index(i)<l:
        ans+=1
        l=p.index(i)
print(ans)


# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
m=float('INF')
ans=0

for i in range(n):
    if p[i]<=m:
        ans+=1
        m=p[i]
print(ans)
# Original solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
P = [int(x) for x in input().split()]

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

# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(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)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
count = 0
for i in range(n):
    if i == 0:
        count += 1
    else:
        if min(p[:i]) >= p[i]:
            count += 1
print(count)

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
m = 10**10
count = 0
for i in range(n):
    if p[i] <= m:
        count += 1
    m = min(m,p[i])
print(count)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print(cnt)


# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print((sum(ans)))

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))

ans = [0]*N
min_cal = [0]*N
min_cal[0] = P[0]

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

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

print((sum(ans)))