CodeEff/ECCO huggingface dataset:
# Original solution
# C - Low Elements
def main():
    N, *P = list(map(int, open(0).read().split()))
    ans, cur_min = 0, P[0]
    for i in P:
        if i <= cur_min:
            ans += 1
        cur_min = min(cur_min, i)
    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
# C - Low Elements
def main():
    N, *P = list(map(int, open(0).read().split()))
    ans, cur_min = 0, P[0]
    for i in P:
        if i <= cur_min:
            ans += 1
            cur_min = i
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
a = int(eval(input()))
array = list(map(int, input().strip().split()))
out = 0
for i in range(a):
    minn = min(array[0:i+1])
    out = out + 1 if array[i] == minn else out
print(out)

# Optimized solution
a = int(eval(input()))
array = list(map(int, input().strip().split()))
out = 0
min_num = array[0]
for i in array:
    min_num = min(min_num, i)
    out = out + 1 if i == min_num else out
print(out)
# Original solution
#!/usr/bin/env python
# coding: utf-8

# In[15]:


N = int(eval(input()))
P = list(map(int, input().split()))
print((sum([1 if x == min(P[:i+1]) else 0 for i,x in enumerate(P)])))


# In[ ]:






# Optimized solution
#!/usr/bin/env python
# coding: utf-8

# In[22]:


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


# In[23]:


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


# In[ ]:
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
c = 0
for i in range(N):
  flag = True
  for j in range(i):
    if P[j] < P[i]:
      flag = False
      break
  if flag:
    c += 1
print(c)

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

ret = 0
for i in range(n):
    f = True
    for j in range(i):
        f = f and (p[i] <= p[j])
        if not f:
            break
    if f:
        ret +=1

print(ret)

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

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

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

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

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

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

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

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

counter = 1
minimum = P[0]
for i in range(1, N):
    minimum = min(minimum, P[i])
    if minimum==P[i]:
        counter += 1
print(counter)
# Original solution
N = int(eval(input()))
l = input().split(" ")
P = [int(n) for n in l]

# i=1は必ずOK
c = 1

for i in range(1,N):
  n_i = P[i]
  p = P[:i+1]
  
  for j in range(i+1):
    if p[j] < n_i:
      break
      
  if j==i:
    c+=1
    
print(c)

# Optimized solution
N = int(eval(input()))
l = input().split(" ")
P = [int(n) for n in l]

# i=1は必ずOK
c = 1
min = P[0]

for i in range(1,N):
  p = P[i]
  if p<=min:
    c+=1
    min=p
    
print(c)
# Original solution

n = int(eval(input()))
p = list(map(int,input().split()))
ans = 1
l = []

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

print(ans)


# Optimized solution

n = int(eval(input()))
p = list(map(int,input().split()))
ans = 0
currentMin = 10 ** 9
s = []

for i in range(n):
    if currentMin > min(currentMin,p[i]):
        currentMin = min(currentMin,p[i])
        s.append(currentMin)
    else:
        s.append(currentMin)

for i in range(len(p)):
    if p[i] == s[i]:
        ans += 1

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

count = 0
while True:
    if len(p) == 1:
        break
    num = p.pop(-1)
    if num <= min(p):
        count += 1
print((count+1))


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

count = 0

m = p[0]
for i in range(len(p)):
    if m >= p[i]:
        count += 1
        m = p[i]

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

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


# Optimized solution
INF=float('inf')

def main():
    N=int(eval(input()))
    P=[int(_) for _ in input().split()]
    tmp=INF
    ans = 0

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

main()
# Original solution
# 初期入力
N = int(eval(input()))
P = list(map(int, input().split()))

#　右から１つ目と２つ目だけ比較し分岐
count =1 # 一つ目（添え字０）は必ずOK
for i in range(1,N):
    if P[i-1] < P[i]: # 増えていたら×
        #print(P[i],P[:i+1])
        continue
    elif P[i] ==min(P[:i+1]): # 減っていてかつMinならOK
        #print(P[i],P[:i+1])
        count +=1
print(count)

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

#　右から１つ目と２つ目だけ比較し分岐
count =1 # 一つ目（添え字０）は必ずOK
P_min = P[0]
for i in range(1,N):
    if P[i-1] < P[i]: # 増えていたら×
        #print(P[i],P[:i+1])
        continue
    elif P[i] <= P_min: # 今までのPで最小値ならOK
        #print(P[i],P[:i+1])
        count +=1
        P_min = P[i]
print(count)
# Original solution
n=int(eval(input()))
l=list(map(int, input().split()))
cnt=0
for i in range(1,n+1):
	if l[i-1]==min(l[:i]):
		cnt+=1
print(cnt)

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

result = 1
for i in range(1,n):
  if ps[i] < min(ps[:i]):
    result += 1
print(result)

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

result = 0
min_p = ps[0]
for i in range(0,n):
  if ps[i] <= min_p:
    result += 1
    min_p = ps[i]
print(result)
# Original solution
n=int(eval(input()))
l=list(map(int,input().split()))
mi=10**9
mi_lst=[]
cnt=0
for i in range(n):
  if l[i]<mi:
    mi_lst.append(l[i])
    mi=min(mi,l[i])
    cnt+=1
  else:mi_lst.append(l[-1])
print(cnt)

# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
mi=10**9
cnt=0
for i in range(n):
  if l[i]<mi:
    mi=min(mi,l[i])
    cnt+=1
print(cnt)
# Original solution
n = int(eval(input()))
plist = list(map(int,input().split()))

islow = True
counter = 0
min = 0

for i in range(len(plist)):
    islow = True
    if i == 0:
        counter += 1
        min = plist[i]
        current_min = i
    elif min > plist[i]:
        for j in range(current_min+1, plist.index(plist[i-1])):
            if plist[i] <= plist[j]:
                pass
            else:
                islow = False
                break
        if islow:
            counter += 1
            min = plist[i]
            current_min = i
            
print(counter)  

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

islow = True
counter = 0
min = 0

for i in range(len(plist)):
    islow = True
    if i == 0:
        counter += 1
        min = plist[i]
        current_min = i
    elif min > plist[i]:
        counter += 1
        min = plist[i]
        current_min = i
        
print(counter)
# Original solution
n = int(eval(input()))
l = list(map(int,input().split()))
count = 0
ll = [l[0]]
for i in range(n):
  m = l[i]
  ll.append(m)
  if min(ll) == m:
    count = count + 1
print(count)
    

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

m=a[0]
ans=0
for i in a:
  if i<=m:
    ans+=1
  m=min(i,m)
  #print(m)
  
print(ans)

# Optimized solution
now_min=float("inf")
n=int(eval(input()))
p=list(map(int,input().split()))
ans=0
for pi in p:
  if pi<=now_min:
    ans+=1
    now_min=pi
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 = 0
min = n+1

for i in range(n):
  if P[i] < min:
    min = P[i]
    ans += 1
print(ans)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
count=1
for i in range(1,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
pmin=float('inf')
for i in range(n):
    pmin=min(pmin,p[i])
    if p[i]<=pmin:
        count+=1
print(count)
# Original solution
import sys

n_in = eval(input())
result = input().split()
total = 0
n_in = int(n_in)

for k0 in range(n_in):
    count = 0
    for l0 in range(k0):
        if int(result[k0]) <= int(result[l0]):
            count += 1
    if count == k0:
        total += 1

print(total)


# Optimized solution
import sys

n_in = eval(input())
result = input().split()
total = 0
n_in = int(n_in)
p_min = int(result[0])
for k0 in range(n_in):
    count = 0
    if int(result[k0]) <= p_min:
        total += 1
        p_min = int(result[k0])

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

print((sum(l[i] == min(l[:i+1]) for i in range(n))))

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

m = 200001
ans = 0

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

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

m = 200001
ans = 0

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

print(ans)

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

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

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


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

for i in range(N):
    if P[i] <= minimum:
        answer += 1
    minimum = min(P[i], minimum)
print(answer)
# Original solution
N = int(eval(input()))
P = [int(k) for k in input().split()]

result = 0
for i in range(N):
    for j in range(0,i):
        # j < i
        if P[i] > P[j]:
            result = result - 1
            break

print((N+result))


# Optimized solution
N = int(eval(input()))
P = [int(k) for k in input().split()]

maxes = []
mins  = []

max = 0
min = 0
result = 0

for i in range(N):
    if i == 0:
        max = P[i]
        min = P[i]
    else:
        if(max < P[i]):
            max = P[i]
        if(min > P[i]):
            min = P[i]

    maxes.append(max)
    mins.append(min)

for i in range(N):
    if mins[i] == P[i]:
        result = result + 1

print(result)
# Original solution
n = int(eval(input()))
import sys
pn = list(map(int, sys.stdin.readline().split()))

ans = 1

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

print(ans)

# Optimized solution
n = int(eval(input()))
import sys
pn = list(map(int, sys.stdin.readline().split()))

ans = 1
mini = pn[0]

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

print(ans)
# Original solution
N = int(eval(input()))
line = list(map(int,input().split()))
a = 0
p = []
for i in line:
    p.append(i)
    m = min(p)
    if m >= i:
       a += 1

print(a)

# Optimized solution
N = int(eval(input()))
line = list(map(int,input().split()))
a = 1
m = line[0]
for i in range(N-1):
    if m >= line[i]:
        m = line[i]

    if m >= line[i+1]:
       a += 1

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

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

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
cnt =0
mi=n + 1
for i in range(1,n+1):
    mi = min(mi,p[~-i])
    if mi == p[i-1]:
        cnt+=1

print(cnt)
# Original solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    count = 0
    for i in range(0, n):
        for j in range(0, i + 1):
            if p[i] > p[j]:
                break
            elif j == i:
                count += 1
    print(count)


if __name__ == "__main__":
    main()


# Optimized solution
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    count = 0
    n_min = 0
    for i in range(0, n):
        if i == 0:
            count += 1
            n_min = p[i]
            continue
        if p[i] <= n_min:
            count += 1
            n_min = p[i]
    print(count)


if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
c = 0
for i in range(n):
    c += all(p[i] <= p[j] for j in range(i))
print(c)


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


# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
ans = 0
mn = float('inf')
for i in range(n):
    if p[i] < mn:
        ans += 1
    mn = min(mn,p[i])
print(ans)
# Original solution
n=int(eval(input()))
List=list(map(int,input().split()))
newList =[0] * n
count = 0
for i in range(1, n + 1):
    # print(i)
    # print(List[0:i])
    # print(min(List[0:i]))
    newList[i - 1] = min(List[0:i])

# print(newList)
for j in range(n):
    if(List[j] <= newList[j]):
        count = count + 1
print(count)

# Optimized solution
n=int(eval(input()))
List=list(map(int,input().split()))
newList =[0] * n
count = 0
min = List[0]
# print(List)
for i in List:
    # 最小値更新
    if i < min:
        min = i
    # カウントする
    if min >= i:
        count = count + 1

print(count)
# Original solution
# 任意のj <= iに対して P[i] <= P[j]

N = int(eval(input()))
P = [int(e) for e in input().split()]
i_count = 0

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

print(i_count)


# Optimized solution
N = int(eval(input()))
P = [int(e) for e in input().split()]
i_count = 0
min_P = 200001

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

print(i_count)
# Original solution
N=int(eval(input()))
p = list(map(int,input().split()))
cnt=0
x=[]
for i in range(N):
    if i==0:
        x+=[p[i]]
        cnt+=1
    else:
        mi = min(x)
        if p[i] <= mi:
            cnt+=1
            x += [p[i]]
        else:
            continue
print(cnt)

# Optimized solution
N=int(eval(input()))
p = list(map(int,input().split()))
cnt=0
x=[]
for i in range(N):
    if i==0:
        x=p[i]
        cnt+=1
    else:
        if p[i]<x:
            x=p[i]
        if p[i] <= x:
            cnt+=1
            x = p[i]
        else:
            continue
print(cnt)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
sum=0
for i in range(n):
  count=0
  l=i
  for j in range(l):
    if p[l]<=p[j]:
      count+=1
  if count==i:
    sum+=1
print((str(sum)))


# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
count=0
min=1000000
for i in range(n):
  if p[i]<=min:
    count+=1
    min=p[i]
  
print((str(count)))
# Original solution
def number(m,l):
  count=0
  mini=l[0]
  for i in range(m):
    if l[i]<=mini:
      mini=l[i]
      #miniはi-1番目のうち最も小さい値であるから、これより小さかったら、i-1番目のどれよりも小さい
      count+=1
  return count

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

# Optimized solution
def number(l):
  count=0
  mini=l[0]
  for i in range(n):
    if l[i]<=mini:
      mini=l[i]
      #miniはi-1番目のうち最も小さい値であるから、これより小さかったら、i-1番目のどれよりも小さい
      count+=1
  return count

n=int(eval(input()))
p=list(map(int,input().split()))
result=number(p)
print(result)
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 21:01:18 2020

@author: over-
"""

N=int(eval(input()))
P=input().split()

c=1
for i in range(1,N):
    bool=True
    for j in range(i):
        if int(P[i])>int(P[j]): 
            bool=False
            break
    if bool: c+=1

print(c)

# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 21:01:18 2020

@author: over-
"""

N=int(eval(input()))
P=input().split()

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


print(c)
# Original 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)


# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))
minimal = float('inf')
ans = 0
for i in P:
    if minimal >= i:
        ans += 1
        minimal = i
print(ans)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))

count = 0
for i in range(n):
    li = p[:i+1]
    if min(li) == 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):
    if m >= p[i]:
        m = p[i]
        count += 1
        
print(count)
# Original solution
N = int(eval(input()))
ps = [int(i) for i in input().split()]

cnt = 0
mark = ps[0]
for p in ps:
    if mark >= p:
        cnt += 1
        mark = min(mark, p)

print(cnt)


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

cnt = 1
mark = ps[0]
for p in ps[1:]:
    if mark >= p:
        cnt += 1
        mark = p

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

count = 1; Pj = [P[0]]
for i in range(1, N):
    if min(Pj) > P[i]:
        count += 1
    Pj.append(P[i])

print(count)

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

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

print(count)
# Original solution
N = int(eval(input()))
P = [int(i) for i in input().rstrip().split(' ')]
c = 0
for i,p in enumerate(P):
    for q in P[:i+1]:
        if p > q:
           break
    else:
        c += 1
print(c)

# Optimized solution
N = int(eval(input()))
P = [int(i) for i in input().rstrip().split(' ')]
c = 0
m = 2*10**5
for i,p in enumerate(P):
    if m >= p:
        m = p
        c += 1
print(c)
# Original solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if min(P[:i+1]) >= P[i]:
        cnt += 1
print(cnt)

# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
P = list(map(int, input().split()))
cnt = 0
low = 200001
for i,p in enumerate(P):
    if p < low:
        low = p
    if p <= low:
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
count = 1

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

print(count)

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

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

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


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

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

print(count)


# Optimized solution
N = int(eval(input()))
P = [int(i) for i in input().split()]
count = 0
min_int = 2 * 10**5
for i in range(0, N):
    if P[i] <= min_int:
        count += 1
        min_int = P[i]

print(count)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
l=[]
for i in range(n):
  l.append(i+1)
if p[0]==1:
  print((1))
else:
  ans=0
  k=l.index(1)
  for i in range(n):
    if p[n-i-1]==l[0]:
      ans+=1
      l.remove(l[0])
    else:
      l.remove(p[n-i-1])
  print(ans)

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

print(ans)

# Optimized solution
N = int(eval(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)
# Original solution
import heapq
def main():
    N = int(eval(input()))
    P = [int(x) for x in input().split()]
    ls = [0 for _ in range(N)]
    ans = 0
    for i in range(N):
        ls[P[i]-1] = 1
        if sum(ls[0:P[i]])==1:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()

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

def main():
    N = int(eval(input()))
    P = [int(x) for x in input().split()]
    ls = [0 for _ in range(N)]
    ans = 0
    mins = 10**10
    for i in range(N):
        mins = min(mins,P[i])
        if mins==P[i]:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
P = [int(i) for i in input().split()]

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

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

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

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

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

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