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

ans_r=0
for p in range(0, N):
  for q in range(0, p):
    if (P[p] > P[q]):
      ans_r += 1
      break
print((N-ans_r))



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

ans_r=0
min_num=P[0]
for p in range(0, N):
  if (min_num > P[p]):
    min_num=P[p]
  if (min_num < P[p]):
    ans_r += 1
print((N-ans_r))
# Original solution
n = int(eval(input()))
an = [int(i) for i in input().split()]
lowe, an_sub = 0, []
for i in range(0, n):
    an_sub = an[0:i + 1]
    if an_sub[i] <= min(an_sub):
        lowe += 1
print(lowe)

# Optimized solution
n = int(eval(input()))
an = [int(i) for i in input().split()]
lowe, min_an_sub = 0, an[0]
an_sub = []
for i in range(0, n):
    an_sub.append(an[i])
    min_an_sub = min(min_an_sub, an[i])
    if an_sub[i] <= min_an_sub:
        lowe += 1
print(lowe)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
min_sp, cnt = p[0], 0
for i in range(n):
    if p[i] <= min_sp:
        cnt += 1
        min_sp = p[i]
print(cnt)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
min_sp, cnt = p[0], 0
for pi in p:
    if pi <= min_sp:
        cnt += 1
        min_sp = pi
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    flag = True
    for j in range(i):
        if P[i] > P[j]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
ans = 0
minx = 10**9
for i in range(N):
    if minx > P[i]:
        ans += 1
        minx = P[i]
print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
s = 0
for i in range(N):
    if P[i] == min(P[0:i+1]):
        s += 1
print(s)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))
s = 0
P = (A[0:N])
Q = A
for i in range(N-1):
    if Q[i] < Q[i+1]:
        Q[i+1] = Q[i]
for i in range(N):
    if P[i] == Q[i]:
        s += 1
print(s)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = 0
bit = 0

for i in range(n):
  kkk = ( 1<<(a[i]-1) ) -1
  if bit&kkk == 0:
    ans += 1
  bit += 1<<(a[i]-1)
  
    
  
print(ans)




# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
mini = 10**9
ans = 0
for i in range(n):
  if a[i] < mini:
    ans += 1
    mini = a[i]
    
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()))

'''
参考
https://cocoinit23.com/abc152/
すべての(i, j)を調べていると制限時間を超過してしまう。
listの2つ目の要素(index=1)から順に見ていって、最小値が更新されたら解をカウントアップする。
ただし、解の最小値は常に1となるので、解の初期値は1にしておくこと。
'''
ans = 1
min_p = P[0]

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

print(ans)
# Original solution
N = int(eval(input()))
num = list(map(int,input().split()))
cnt = 0
flag = False
for i in range(N):
	if(i == 0):
		cnt+=1
		continue
	sub = num[0:i]
	sub_min = min(sub)
	if (num[i] <= sub_min):
		cnt+=1
print(cnt)

# Optimized solution
N = int(eval(input()))
num = list(map(int,input().split()))
cnt = 0
flag = False
num_min = 10**8
for i in range(N):
	if(i == 0):
		cnt+=1
		continue
	num_min = min(num_min,num[i-1])
	if (num[i] <= num_min):
		cnt+=1
print(cnt)
# Original solution
N = int(eval(input()))
L = list(map(int,input().split()))
ans = 1
for i in range(1,N):
    Pj = min(L[:i])
    Pi = L[i]
    if Pj > Pi:
        ans += 1
print(ans)

# Optimized solution
import sys
read = sys.stdin.buffer.read#全部読み込むやつ
readline = sys.stdin.buffer.readline#1行読み込むやつ
readlines = sys.stdin.buffer.readlines#リストで読み込むらしい


N,*L = list(map(int,read().split()))
ans = 0
Pj = L[0]
for i in L:
    Pj = min(Pj,i)    
    if Pj >= i:
        ans += 1
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
m = n
q = []

for i in range(n):
    q.append(p[i])
    if not p[i] <= min(q):
        m -= 1

print(m)

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
m = n
q = 2 * (10 ** 5)

for i in range(n):
    q = min(p[i],q)
    if not p[i] <= q:
        m -= 1

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

count = 0

for i in range(0, len(lstP)):
    lstT = lstP[0:i+1]
    if min(lstT) == lstP[i]:
        count = count + 1

print(count)

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

count = 1
minval = lstP[0]

for i in range(1, len(lstP)):
    val = lstP[i]
    if val <= minval:
        minval = val
        count += 1

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

ans = 0
for i in range(N):
  for j in range(i):
    f = True
    if P[i] >= P[j]:
      f = False
      break
  else:
    ans += 1
print (ans)


# Optimized solution
N = int(eval(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)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))

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

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

mi = P[0]
cnt = 1
for i in range(1,N):
    if P[i] <= mi:
        mi = P[i]
        cnt += 1
print(cnt)
# Original solution
from itertools import accumulate

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

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

for i, p in enumerate(P):
    tmp = list(accumulate(P[0:i+1], min))[-1]
    if p <= tmp:
        ans += 1

print(ans)


# Optimized solution
from itertools import accumulate

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

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1

print(ans)
# Original solution
n = int(eval(input()))
p_list = list(map(int, input().split(" ")))
count = 0
for i in range(n):
    for j in range(i+1):
        if p_list[i] > p_list[j]:
            break
    else:
        count += 1
print(count)


# Optimized solution
n = int(eval(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)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
result = 0
nowmin = P[0]
for i in range(N):
    if P[i]>nowmin:
        pass 
    else:
        if P[i] == min(P[:i+1]):
            result += 1
            nowmin == P[i]
print(result)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
result = 0
nowmin = N
for i in range(N):
    if P[i]>nowmin:
        pass 
    else:
        result += 1
        nowmin = P[i]
print(result)
# Original solution
n = int(eval(input()))
p = input().split()
cnt = 0
for i in range(n):
 ng_flg = 0
 ii = i
 for j in range(ii+1):
  if int(p[j]) < int(p[ii]) :
   ng_flg=1
   break
 if ng_flg == 0:
  cnt +=1
print(cnt)

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

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
count = 0
minn = n
for j in range(len(p)):
  if minn >= p[j]:
    minn = p[j]
    count += 1
print(count)
# Original solution
N = int(eval(input()))
p_list = list(map(int, input().split()))

count = 0 # p_j > p_i である回数
p_length = len(p_list)
for i in range(p_length):
    p_max = min(p_list[:i+1])
    if p_list[i]==p_max:
        count = count + 1

print(count)


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

count = 0 # p_j > p_i である回数
p_length = len(p_list)
p_min = p_list[0] # 現時点での最小値

for i in range(p_length):
    if p_list[i]<=p_min:
        p_min = p_list[i]
        count = count + 1 # カウントを１つ増やす
    else:
        continue

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

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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''


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

mi = 1000000000
cnt = 0
for i in range(n):
    if p[i] <= mi:
        cnt += 1
    if mi > p[i]:
        mi = p[i]

print(cnt)


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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

def main():
    n = int(eval(input()))
    p = list(map(int, input().split()))

    mi = 1000000000
    cnt = 0
    for i in range(n):
        if p[i] <= mi:
            cnt += 1
        if mi > p[i]:
            mi = p[i]
    print(cnt)

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

cnt = 0
p_min = 100000
for i in range(n):
  pi = p[i]
  if i >= 1:
    p_min = min(p[:i])
  if pi <= p_min:
    cnt += 1
print(cnt)


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

cnt = 0
p_min = p[0]
for i in range(n):
  pi = p[i]
  if pi <= p_min:
    cnt += 1
    p_min = pi
print(cnt)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
cnt = 0
for i in range(n):
    state = 1
    for j in range(i):
        if p[i]<=p[j]:
            state = 1
        else:
            state = 0
            break
    if state == 1:
        cnt+=1
print(cnt)

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

ans = 0

for i in range(1, len(P)+1):
    M = min(P[:i])
    if P[i-1] == M:
        ans = ans +1

print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
m = float("inf")
count = 0

for i in P:
    if m > i:
        m = i
    if m == i:
        count += 1
print(count)
# Original solution
n=int(eval(input()))
B=list(map(int,input().split()))
cnt=0
for i in range(n):
  if min(B[:i+1])==B[i]:
    cnt+=1
print(cnt)

# Optimized solution
n=int(eval(input()))
B=list(map(int,input().split()))
cnt=0
maxi=max(B)
for i in range(n):
  if maxi>=B[i]:
    cnt+=1
    maxi=B[i]
print(cnt)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
m =[0] * n
m[0] = p[0]
for i in range(1, n):
  q = sorted(p[:i+1])
  m[i] = q[0]
ans = 0
for i in range(n):
  if p[i] == m[i]:
    ans += 1
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
m =[0] * n
m[0] = p[0]
mi = m[0]
for i in range(1, n):
    mi = min(mi, p[i])
    m[i] = mi
ans = 0
for i in range(n):
  if p[i] == m[i]:
    ans += 1
print(ans)
# 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()))

ans = 0
p_min = p[0]
for i in range(n):
    if p[i] <= p_min:
        ans += 1
        p_min = p[i]
print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
ans_count=N
for i in range(1,N):
    if(P[i]>=min(P[:i])):
        ans_count-=1
print(ans_count)



# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
minP = P[0]
ans = 1
for i in P[1:]:
    if(i<=minP):
        minP = i
        ans += 1
print(ans)
# Original solution
from sys import stdin


def main():
    n = int(stdin.readline())
    p = list(map(int, stdin.readline().split()))

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


if __name__ == "__main__":
    main()


# Optimized solution
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(eval(input()))
    p = list(map(int, input().split()))
    min = p[0]
    ans = 1
    for i in range(1, n):
        if p[i] <= min:
            min = p[i]
            ans += 1
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
count = 0
for i in range(0, N):
    p_i = P[i]
    for j in range(0, i):
        if p_i > P[j]:
            break
    else:
        count += 1

print(count)

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

    if leftmin > P[i]:
        leftmin= P[i]

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


cnt = 0

for i in range(n):
    now_list = p[0:i+1]
    Pi = p[i]
    Pj = min(now_list)
    #print(now_list,Pi,Pj)
    if Pi > Pj:
        cnt += 1
print((n-cnt))


     

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

temp = 11111111111111111
cnt = 0
for i in p:
    temp = min(temp,i)
    if temp >= i:
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

l = []
m = [P[0]]
for i in range(N):
    if P[i] <= min(m):
        m.append(P[i])
        continue
    else:
        l.append(i)
print((N - len(l)))

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

l = []
a = P[0]
for i in range(N):
    if P[i] <= a:
        a = P[i]
        continue
    else:
        l.append(i)
print((N - len(l)))
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

l = []
a = P[0]
for i in range(N):
    if P[i] <= a:
        a = P[i]
        continue
    else:
        l.append(i)
print((N - len(l)))

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

l = 0
a = P[0]
for p in P:
    if p <= a:
        a = p
        l += 1
        continue
print(l)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
count = 0
for i in range(n):
    ans = p[:i+1]
    if min(ans) != p[i]:
        count += 1
print((n-count))

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
count = 0
mi = n+1
for i in range(n):
    mi = min(mi,p[i])
    if mi == p[i]:
        count += 1
print(count)
# Original solution
n = int(eval(input()))
ps = list(map(int, input().split()))
m = 1
fps = []
for i in range(1, n):
  fps.append(ps[i-1])
  if min(fps) > ps[i]:
    m += 1
print(m)

# Optimized solution
n = int(eval(input()))
ps = list(map(int, input().split()))
fps = [ps[0]]
for i in range(1,n):
  if fps[len(fps)-1] > ps[i]:
    fps.append(ps[i])
print((len(fps)))
# Original solution
N, *D = [list(map(int, s.split())) for s in open(0)]
N, D = N[0], D[0]

cnt = 1
min_v = D[0]
for i in range(1, len(D)):
    if min_v >= D[i]:
        cnt += 1
        min_v = D[i]
print(cnt)

# Optimized solution
def main():
    _ = int(eval(input()))
    A = list(map(int, input().split()))
    min_value = 1e10
    cnt = 0
    for a in A:
        if a <= min_value:
            min_value = a 
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()
# Original solution
import queue
import copy
import math
from collections import deque

# そのまま入力文字列の入力
n = int(eval(input()))

# 空白区切りの数値をリスト化
pn = list(map(int, input().split()))

ans = 0
for i in range(0, n):
    if i == 0:
        ans += 1
        continue

    all_small = True

    for j in range(i, -1, -1):
        if pn[i] <= pn[j]:
            continue
        else:
            all_small = False
            break

    if all_small:
        ans += 1


print(ans)

# Optimized solution
import queue
import copy
import math
from collections import deque

# そのまま入力文字列の入力
n = int(eval(input()))

# 空白区切りの数値をリスト化
pn = list(map(int, input().split()))

ans = 0
current_min = n + 1

for i in range(0, n):
    if i == 0:
        current_min = pn[i]
        ans += 1
        continue

    if pn[i] < current_min:
        ans += 1
        current_min = pn[i]
        continue

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

class Node:
  def __init__(self, data):
    self.left = None
    self.right = None
    self.data = data

  def insert(self, data):
    if self.data:
      if data < self.data:
        if self.left is None:
          self.left = Node(data)
        else:
          self.left.insert(data)
      elif data > self.data:
        if self.right is None:
          self.right = Node(data)
        else:
          self.right.insert(data)
    else:
      self.data = data

  def PrintTree(self):
    if self.left:
      return self.left.PrintTree() + 1
    else:
      return 1

root = Node(P[0])
for i in range(1, len(P)):
  root.insert(P[i])

print((root.PrintTree()))

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

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

print(cnt)
# Original solution
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    a = list(map(int, r.split()))
    #a, b = map(int, r.split())
    #a = [int(s[i]) for i in range(1, n+1)]
    #a = [list(map(int, r.split())) for i in range(1,n+1)]

    ma = max(a)
    mi = min(a)
    res = a.count(mi)
    d = [i for i in a if ma != i or mi != i]
    for i in range(1,len(d)):
        b = a[:i]
        if min(b) >= a[i]:
            res += 1
    print(res)

    #'Yes', 'No', 'YES', 'NO', ':(', 'Yay!'
    #res = 0
    #a, b = map(int, r.split())
    #print()

if __name__ == '__main__':
    main()



# Optimized solution
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    a = list(map(int, r.split()))
    #a, b = map(int, r.split())
    #a = [int(s[i]) for i in range(1, n+1)]
    #a = [list(map(int, r.split())) for i in range(1,n+1)]

    res = 1
    bk = a[0]
    for i in range(1,n):
        if bk >= a[i]:
            bk = a[i]
            res += 1
    print(res)


#    b = [0]*n
#    for i in range(n):
#        b[a[i]-1] = i

#    res = 0
#    mem = b[0]
#    for i in range(1,n):
#        if mem <= b[i]:
#            print(b[i])
##            mem = b[i]
#        else:
#            res += 1
#    print(res)

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
P_ls = list(map(int, input().split(' ')))
rst = 0
for i in range(N):
    val = P_ls[i]
    if min(P_ls[: i + 1]) == val:
        rst += 1
print(rst)

# Optimized solution
N = int(eval(input()))
P_ls = list(map(int, input().split(' ')))
rst, min_val = 0, 10 ** 6
for i in P_ls:
    if min_val >= i:
        rst += 1
        min_val = i
print(rst)
# Original solution
N=int(eval(input()))
S=list(map(int, input().split()))
ans=0
for i in range(0,N):
  
  if min(S[:i+1])==S[i]:
    ans+=1
print(ans)

# Optimized solution
N=int(eval(input()))
S=list(map(int, input().split()))
Min=2*(10**5)
ans=0
for i in S:
  if Min>=i:
    Min=i
    ans+=1
    
print(ans)
# Original solution
n = int(eval(input()))
P = list(map(int, input().split()))

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

print(ans)


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

ans = 0
min_p = P[0]
for p in P:
    if p <= min_p:
        ans += 1
        min_p = p

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

for i in range(n):
  if List[i] <= min(List[0:i+1:]):
    count += 1
print(count)

# Optimized solution
n = int(eval(input()))
List = list(map(int, input().split()))
count = 1
min = List[0]

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

for i in range(n):
  if min > List[i]:
    min =List[i]
    count += 1
print(count)


# Optimized solution
n = int(eval(input()))
l = list(map(int,input().split()))
min = l[0]
cnt = 0

for i in range(n):
  if min >= l[i]:
    cnt += 1
    min = l[i]
print(cnt)
# Original solution
#!/usr/bin/env python3

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

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


main()

# Optimized solution
#!/usr/bin/env python3

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

    mini = 10**6
    cnt = 0
    for _ in P:
        if _ < mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()
# 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 :
        mn = min(p[0:i+1])
        if mn == p[i] :
            count += 1
print(count)


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

ans = 0

for index, p in enumerate(P):
  flag = 0

  for i in range(index):
    if p > P[i]:
      flag = 1

  if flag == 0:
    ans += 1

print(ans)

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

ans = 0
min = 10000000

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

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

sum = 0
for i in range(n):
  ans = True
  for j in range(i):
    if P[i] > P[j]:
      ans = False
  if ans:
    sum += 1
    
print(sum)

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

sum = 0
min = n
for i in range(n):
  if min >= P[i]:
    min = P[i]
    sum += 1
    
print(sum)
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))
ans=1
for i in range(1,N):
    if min(P[:i])==min(P):
        break
    if min(P[:i])>P[i]:
        ans+=1
print(ans)

# Optimized solution
N=int(eval(input()))
P=list(map(int,input().split()))
x=N+1
cnt=0

for i in range(N):
    if P[i]<x:
        cnt+=1
        x=P[i]
print(cnt)
# Original solution
n=int(eval(input()))
li = list(map(int,input().split()))
count=1
li2=[]
if(len(li)!=1):
    for i in range(1,n):
        li2=li[0:i]
        if(min(li2)>=li[i]):
            count+=1
print(count)


# Optimized solution
n=int(eval(input()))
li = list(map(int,input().split()))
count=1
m=n
for i in range(1,n):
    m=min(m,li[i-1])
    if(m==1):
        break
    if(m>=li[i]):
        count+=1
print(count)