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

x = list(range(1, n+1))

cnt = 0
for i in p:
    if x.index(i) == 0:
        cnt += 1
    x.remove(i)

print(cnt)

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

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

# for i, p in enumerate(P):
#     subary = P[:i+1]
#     if (min(subary) >= p):
#         result += 1

for i in range(len(P)):
    subary = P[:i+1]
    if (min(subary) >= P[i]):
        result += 1

print(result)


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

minValue = P[0]

for i, p in enumerate(P):
  if (minValue >= p):
    result += 1
    minValue = p

print(result)
# Original solution
N = int(eval(input()))
P_list = list(map(int,input().split()))
M_list = []
cnt = 0
for j in range(1,N+1):
  M_list.append(min(P_list[:j]))

for i in range(N):
  if M_list[i] == P_list[i]:
    cnt += 1

print(cnt)

# Optimized solution
N = int(eval(input()))
P_list = list(map(int,input().split()))
M = P_list[0]
cnt = 1

for i in range(N):
  if M > P_list[i]:
    cnt += 1
    M = P_list[i]

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

#print(N)
#print(P)

SUCCESS = N
pre_max = P[0]
pre_min = P[0]
for i in range(N):
    j = i - 1
    if pre_max < P[i]:
        #print(i, j, pre_max)
        pre_max = P[j]
        SUCCESS -= 1
        continue
    if pre_min < P[i]:
        #print(i, j, pre_min)
        #pre_min = P[j]
        SUCCESS -= 1
        continue
    while j >= 0:
        if pre_min > P[j]:
            pre_min = P[j]      
        if P[i] > P[j]:
            #print("Fail", i,j)
            SUCCESS -= 1
            break        
        j -= 1

print(SUCCESS)

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

#print(N)
#print(P)

SUCCESS = N
pre_max = P[0]
pre_min = P[0]
for i in range(N):
    j = i - 1

    if pre_min < P[i]:
        SUCCESS -= 1
        continue
    else:
        pre_min = P[i]
print(SUCCESS)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

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

print((len(test)))


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

dummy = 2*10**5
answer = 0

for p in P:
  if p <= dummy:
    answer += 1
    dummy = p

print(answer)
# 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
tempmin = P[0]
for i in range(1,N):
  if tempmin >= P[i]:
    tempmin = 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):
    if p[i] <= min(p[:i+1]):
        ans += 1

print(ans)

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

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

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

p = [int(s) for s in input().split()]
flag = -1
m_ans = 0
for i in range(n):
    i_min = min(p[:i+1])
    if(i_min < p[i]):
        #print(p[j],p[i])
        m_ans += 1
    


print((n - m_ans))

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

p = [int(s) for s in input().split()]
flag = -1
m_ans = 1
p_z = p[0]
for i in range(1,n):
    p_z = min(p_z,p[i])
    if(p_z >= p[i]):
        #print(p[j],p[i])
        m_ans += 1
    
print(m_ans)
# Original solution
N=int(eval(input()))
p=list(map(int,input().split()))
a=0

for i in range(N):
  if min(p[0:i+1])==p[i]:
    a+=1
print(a)

  

# Optimized solution
N=int(eval(input()))
p=list(map(int,input().split()))
a=0
b=p[0]
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(' ')))

num = 0
for i in range(N):
  if all([P[i] <= P[j] for j in range(i)]):
    num += 1
      
print(num)

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

min = N
num = 1
for i in range(1, N):
  if min > P[i - 1]:
    min = P[i - 1]
  if P[i] <= min:
    num += 1
    
print(num)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
miss = 0
max = p[0]
for i in range(n):
    s = p[0:i]
    if not s:
        continue
    if p[i] > p[i-1]:
        miss += 1
        continue
    if max < p[i]:
        max = p[i]
    if p[i] > max:
        miss += 1
        continue

    s = sorted(s,reverse=True)
    for j in range(i):
        if p[i] > s[j]:
            miss += 1
            break

print((n-miss))

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

for i in range(n):
    if t >= p[i]:
        cnt += 1
        t = p[i]


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

# Optimized solution
N = int(eval(input()))
res = 0
p = list(map(int, input().split()))
mini = p[0]
for i in range(N):
    mini = min(mini, p[i])
    if mini >= p[i]:
        res += 1    
print(res)
# Original solution
eval(input())
lst=[]
s=0
for i in map(int,input().split()):
    lst.append(i)
    if min(lst)==i:
        s+=1
print(s)

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

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

cnt = 0

for i in range(N):
    if i == 0:
        cnt += 1
    else:
        if all(list([x > P[i] for x in P[:i]])):
            cnt += 1

print(cnt)

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

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

m = 2 * (10 ** 5) + 1

cnt = 0

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

ans = 0
for i,p in enumerate(Ps):
  if p==min(Ps[:i+1]):
    ans += 1
  if p==1:
    break
    
print(ans)

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

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

count = 1
for i in range(1,n):
#  print(i, min(p[:i+1]), p[i])
  if min(p[:i+1]) == p[i]:
    count += 1
print(count)
    

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

# Optimized solution
N = int(input().strip())
ns = [int(x) for x in input().split(' ')]
cnt=0
mini = 200001
for i in range(len(ns)):
  if ns[i] <mini:
    cnt+=1
    mini=ns[i]
print(cnt)
# Original solution
n=int(eval(input()))
a=list(map(int, input().split()))
ans=0
for i in range(n):
    if a[i]==min(a[:i+1]):
        ans+=1
print(ans)

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

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
count=0
min=100000000
for i in range(n):
	if min>=p[i]:
		count+=1
		min=p[i]
print(count)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
ans = n
for i in range(1,n):
    if i> n- p[i]:
        ans -=1
    else:
        for j in range(i+1):
            r = True
            if p[i]>p[j]:
                ans -=1
                break
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
ans = 0
m = 200001
for i in p:
    if i<m:
        ans+=1
        m=i
print(ans)
# 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()))
m = p[0]
ans=1
for i in p[1:]:
    if m>i:
        ans+=1
        m=i
print(ans)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
ct=1
i=1
maxn=p.index(i)
while True:
    if maxn==0:
        break
    p=p[0:maxn]
    i+=1
    maxn=p.index(min(p))
    ct+=1
print(ct)

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
ct=1
minn=p[0]
for i in range(1,n):
    if minn==1:
        #ct+=1
        break
    elif minn>p[i]:
        minn=p[i]
        ct+=1
print(ct)
# Original solution
n = int(eval(input()))
p = [int(x) for x in input().split()]

ans = 0

for i in range(n):
    baes = p[i]
    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 = [int(x) for x in input().split()]

ans = 1
base = p[0]

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

print(ans)
# Original solution
num = int(eval(input()))
p = list(map(int, input().split()))
pList = list(p)
ret = 0

for i in range(num):
    check = True
    for j in range(i):
        if pList[i] >= pList[j]:
            check = False
            break
    if check == True:
        ret = ret + 1

print(("{}".format(ret)))

# Optimized solution
num = int(eval(input()))
p = list(map(int, input().split()))
pList = list(p)
ret = 0

min = pList[0]
for i in range(num):
    if pList[i] <= min:
        min = pList[i]
        ret = ret + 1

print(("{}".format(ret)))
# 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()))
ans = 0
pmin = 10**7
for i in range(n):
    pmin = min(pmin,p[i])
    if p[i] <= pmin:
        ans+=1
print(ans)
# Original solution
# 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)


# Optimized solution
# # 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)
# Original solution
N = int(eval(input()))

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

cnt = 0
for i in range(N)[::-1]:
  for j in range(N)[i::-1]:
    if P[i] > P[j]:
      break
    elif j == 0:
      cnt += 1

print(cnt)  

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

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

cnt = 1
m = P[0]
for i in P[1:]:
  if i < m:
    m = i
    cnt += 1

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

count = 1
for i in range(1,n-1):
  if min(pList[:i]) >= pList[i]:
    count += 1

if len(pList) != 1:
    if min(pList[:-1]) >= pList[-1]:
      count += 1

print(count)


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

count = 0
minL = pList[0] 
for i in range(n):
  if minL >= pList[i]:
      count += 1
      minL = pList[i] 
      if minL == 1:
        break

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

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

print(ans) 

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

ans = 1
lst_min = []
for i in range(n):
    if i == 0:
        lst_min.append(lst[i])
    else:
        lst_min.append(
            min(lst_min[i-1], lst[i])
        )
        if lst_min[i] == lst[i]:
            ans += 1
print(ans)
# Original solution
N = int(eval(input()))
#P = [int(i) for i in input().split()]
P = list(map(int, input().split()))
P_min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == P_min:
        count+=1
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1

print(count)

# Optimized solution
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(eval(input()))
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))
ans=1
for i in range(1,N):
  MIN=min(P[0:i])
  if MIN>=P[i]:
    ans+=1
print(ans)    

# Optimized solution
N=int(eval(input()))
P=list(map(int,input().split()))
ans=0
MIN=10**6
for i in range(N):
  MIN=min(MIN,P[i])
  if MIN>=P[i]:
    ans+=1
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
pre = True
ans = 1
for i in range(1,n):
  if pre and p[i]<=p[i-1]:
    ans += 1
  elif not pre and p[i]>p[i-1]:
    pre = False
  else:
    if min(p[:i])>=p[i]:
      ans += 1
      pre = True
    else:
      pre = False
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
pre = True
premin = p[0]
ans = 1
for i in range(1,n):
  if pre and p[i]<=p[i-1]:
    ans += 1
    premin = p[i]
  elif not pre and p[i]>p[i-1]:
    pre = False
  else:
    if premin>=p[i]:
      ans += 1
      pre = True
      premin = p[i]
    else:
      pre = False
print(ans)
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))

t=[P[0]]
ans=1
for n in range(1,N):
    if min(t) < P[n]:
        pass
    else:
        ans+=1
    t.append(P[n])
print(ans)

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

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

temp = arr.index(1)
ans = 1

while(temp!=0):
    val = arr[:temp].index(min(arr[:temp]))
    ans += 1
    temp = val
print(ans)


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

ind = [0]*(n+1)
for i in range(n):
    ind[arr[i]] = i
temp = 100000000
ans = 0
for i in range(1,n+1):
    if ind[i]<temp:
        ans+=1
        temp = ind[i]
print(ans)
# Original solution
N = int(eval(input()))
P = [int(x) for x in input().split()]
R = 1000000
c = 0
for i in range(N):
  if min(R, P[i])==P[i]:
    c += 1
    R = P[i]
  else:
    pass
print(c)

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))
m = P[0]
S = 0
for p in P:
  if m>=p:
    S += 1
  m = min(m, p)
print(S)
# Original solution
N = int(eval(input()))
lis = list(map(int, input().split()))
c = 0
if N == 1:
  print((lis[0]))
else:
  for i in range(N):
    f = True
    for j in range(i):
      if lis[i] > lis[j]:
        f = False
    if f:
      c += 1
  print(c)

# Optimized solution
N = int(eval(input()))
lis = list(map(int, input().split()))
c = 1
j_min = lis[0]
if N == 1:
  print(c)
else:
  for i in range(1,N):
    if j_min > lis[i]:
        c += 1
        j_min = lis[i]
  print(c)
# Original solution
from sys import stdin
N = int(stdin.readline().rstrip())
num_list = [int(i) for i in stdin.readline().rstrip().split()]
output = 0
for n in range(0, N):
    now_value = num_list[n]
    over_list = [i for i in num_list[:n] if i > now_value]
    if len(over_list) == len(num_list[:n]):
        output += 1
print(output)

# Optimized solution
from sys import stdin
N = int(stdin.readline().rstrip())
num_list = [int(i) for i in stdin.readline().rstrip().split()]
output = 0
min_value = float("inf")
for n in range(0, N):
    now_value = num_list[n]
    if min_value > now_value:
        output += 1
        min_value = now_value
    # over_list = [i for i in num_list[:n] if i > now_value]
    # if len(over_list) == len(num_list[:n]):
    #     output += 1
print(output)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

cout = 0



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



print(cout)



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

cout = 1
saisyou = p[0]

for i in range(n-1):
    if p[i+1] <= saisyou:
        cout = cout + 1
        saisyou = p[i+1]

print(cout)
# Original solution
N = int(eval(input()))
P = input().split()
count = 0

for i in range(N):
  flag = True
  for j in range(i):
    if int(P[i]) > int(P[j]):
      flag = False
      break
  if flag:
    count += 1
print(count)


# Optimized solution
N = int(eval(input()))
P = input().split()
count = 0
cur_min = int(P[0])

for i in range(N):
  if cur_min >= int(P[i]):
    cur_min = int(P[i])
    count += 1
print(count)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
List = []
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    tmp = P[i-1]
    List.append(tmp)
    if(P[i] <= min(List)):
      ans += 1
print((str(ans)))

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
mi = P[0]
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    if(P[i] <= mi):
      ans += 1
      mi = P[i]
print((str(ans)))
# Original solution
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(eval(input()))


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return list(map(int, input().split()))


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    for i in range(n):

        if i == 0 or p[i] <= min(p[:i]):
            cnt += 1

        # temp = True
        # for j in range(i):
        #     if p[i] > p[j]:
        #         temp = False
        #         break
        # if temp:
        #     cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()


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


# 入力を整数に変換して受け取る
def input_int():
    return int(eval(input()))


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return list(map(int, input().split()))


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    pre_min = 10 ** 6
    for i in range(n):

        if i == 0 or p[i] <= pre_min:
            cnt += 1

        pre_min = min(pre_min, p[i])

        # temp = True
        # for j in range(i):
        #     if p[i] > p[j]:
        #         temp = False
        #         break
        # if temp:
        #     cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()
# 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
  if P[i] == 1:
    break
    
print(ans)


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

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

  print(ans)

if __name__ == "__main__":
	main()
# Original solution
n = int(eval(input()))
pp = list(map(int, input().split()))

cnt = 0

for i in range(n):
    if min(pp[:i + 1]) >= pp[i]:
        cnt += 1

print(cnt)

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

cnt = 0
min_val = 2 * 10 ** 5 + 1

for p in pp:
    if min_val >= p:
        cnt += 1
        min_val = p

print(cnt)
# Original solution
N = int(eval(input()))
P = [int(x) for x in input().split()]
ans = 0
m = 0
for i in range(N):
    for j in range(m, i):
        if P[i] > P[j]:
            m = j
            break
    else:
        ans += 1
print(ans)


# Optimized solution
N = int(eval(input()))
P = [int(x) for x in input().split()]
mins = [0]*N
mins[0] = P[0]
for n in range(1,N):
    mins[n] = min(P[n],mins[n-1])
ans = 0
for i in range(N):
    if P[i] == mins[i]:
        ans += 1
print(ans)
# Original solution
import bisect
n = int(eval(input()))
p = list(map(int,input().split()))
l = []
c = 0
for i in p:
  ind = bisect.bisect_left(l,i)
  l.insert(ind, i)
  if ind == 0:
    c += 1
print(c)

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

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

ans = n
for i in range(n):
    if min(lists[:i+1]) != lists[i]:
        ans -= 1
print(ans)

# Optimized solution
# abc152

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

std = lists[0]
ans = 1

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

count = 0

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

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

count = 0
m = p[0]

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

counter = 0

for i in range(n):
  if i == 0:
    counter += 1
  else:
    Min = min(p[:i+1])
  
    if Min == p[i]:
      counter += 1
    else:
      pass
  
print(counter)

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

counter = 0
Min = p[0]

for i in range(n):
  if i == 0:
    counter += 1
  else:
    if p[i] <= Min:
      counter += 1
      Min = p[i]
  
print(counter)