CodeEff/ECCO huggingface dataset:
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))
x=0
for i in range(N):
    B=0
    a=P[i]
    for j in range(i+1):
        b=P[j]
        if a>b:
            break
        else:
            B+=1
    if i+1==B:
        x+=1
print(x)

# Optimized solution
N=int(eval(input()))
P=list(map(int,input().split()))
x=1
Min=P[0]
for i in range(1,N):
    if Min>P[i]:
        Min=P[i]
        x+=1
print(x)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
result = [False]*N
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if not P[i] <= P[j]:
            flag = False
            break
        elif result[i] == True:
            break
    if flag == True:
        result[i] = True
        count += 1


print(count)

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

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

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
P_min = [2*(10**5)]
for i in range(N-1):
    P_min.append(min(P_min[i],P[i]))
ans = 0
for i in range(N):
    if P_min[i] >= P[i]:
        ans += 1
print(ans)
# Original solution
N = int(eval(input()))
p = list(map(int, input().split()))
M = []
for i in range(N):
    M.append(min(p[:i+1]))

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

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = input().split(" ")

t = 0
list = []
for i in range(N):
    list.append(int(P[i]))
    m = min(list)
    if m == int(P[i]):
        t = t + 1

print(t)

# Optimized solution
N = int(eval(input()))
P = input().split(" ")

t = 1
list = []
for i in range(N):
    list.append(int(P[i]))
    if i == 0:
        m = int(P[0])
    elif int(P[i]) < m:
        m = int(P[i])
        t = t + 1
        
print(t)
# Original solution
[n] = list(map(int, input().split()))
[*p_list] = list(map(int, input().split()))

count = 0

for i,p in enumerate(p_list):
  s_p = p_list[:i+1]
  if min(s_p) == p:
    count += 1

print(count)

# Optimized solution
[n] = list(map(int, input().split()))
[*p_list] = list(map(int, input().split()))

count = 0
p_min = 2 * 10 ** 5

for p in p_list:
  if p_min >= p:
    count += 1
    p_min = p

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

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

def smaller(x, y):
    if x>y:
        return y
    else:
        return x

def minimum(score):
    m = score[0]
    for i in range(1, len(score)):
        m = smaller(m, score[i])
    return m

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

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

m=2*(10**5)+1
count = 0
for i in range(0, n):
  if p[i] <= m:
    m = p[i]
    count = count + 1

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

for i in range(1,N + 1):
	pi = p[i - 1]
	if all(pi <= j for j in p[:i]):
		count += 1

print(count)

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

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

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

count = 0
for i in range(n):
    flg = True
    for j in range(i):
        if p[i] > p[j]:
            flg = False
    if flg:
        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]:
        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, p in enumerate(P):
    if p == min(P[:i + 1]):
        cnt += 1
print(cnt)


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

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

print(count)


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

minimum = N + 1
ans = 0

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

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

c = [True for i in range(n)]
for i in range(1,n):
  for j in range(i):
    if p[i]>p[j]:
      c[i] = False
      break
print((sum(c)))

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

c = [True for i in range(n)]
target = p[0]
for i in range(1,n):
  if p[i]>target:
      c[i] = False
  else:
    target = p[i]
print((sum(c)))
# Original solution
N = int(eval(input()))
p = [int(e) for e in input().split(" ")]
c = 0
for i in range(N):
    if(p[i] <= min(p[0:i + 1])):
        c += 1
print(c)

# Optimized solution
N = int(eval(input()))
p = [int(e) for e in input().split(" ")]
low = p[0]
c = 0
for i in range(N):
    if(p[i] <= low):
        c += 1
        low = p[i]
print(c)
# Original solution
# coding: utf-8
from sys import stdin


def main():
    # コンソール入力を受け取る
    N = int(stdin.readline().rstrip())
    P = stdin.readline().rstrip().split()
    P = [int(i) for i in P]

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


if __name__ == '__main__':
    main()


# Optimized solution
# coding: utf-8
from sys import stdin


def main():
    # コンソール入力を受け取る
    N = int(stdin.readline().rstrip())
    P = stdin.readline().rstrip().split()
    P = [int(i) for i in P]

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


if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
l = list(map(int,input().split()))
q = 0
a = 0
for i in l:
  a += 1
  if i<=min(l[:a]):
    q += 1
print(q)

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

max0, max1, count = [], 0, 0
for i in p:
    max0.append(i)
    max1 = i
    if max1 == 1:
        count += 1
        break
    elif min(max0) >= max1:
        count += 1
print(count)


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

max0, max1, count = p[0], 0, 0
for i in p:
    max0 = min(max0, i)
    max1 = i
    if max1 == 1:
        count += 1
        break
    elif max0 >= max1:
        count += 1
print(count)
# Original solution
n=int(eval(input()))
l1=input().split()
l=[int(x)for x in l1]
ans=0
for i in range(n):
    list_now=l[0:i+1]
    num_now=l[i]
    list_now.sort()
    if num_now==list_now[0]:
        ans+=1
print(ans)


# Optimized solution
n=int(eval(input()))
l=list(map(int, input().split()))
ans=0
min=2*100000
for i in range(n):
    num_now=l[i]
    if num_now<=min:
        ans+=1
        min=num_now
print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
result = 0
for i in range(1,N+1):
    if P[i-1]==min(P[:i]):
        result += 1
print(result)

# Optimized solution
N = int(eval(input()))
P = [0] + list(map(int, input().split()))
result = 0
minVal = P[1]
for i in range(1,N+1):
    minVal = min(minVal, P[i])
    if P[i]==minVal:
        result += 1
print(result)
# Original solution
# coding:utf-8

N = int(eval(input()))
P = [int(el) for el in input().split(' ')]
ans = 1

for i, p in enumerate(P):
    if i == 0:
        continue
    flag = True
    for j in range(i):
        if p > P[j]:
            flag = False
    if flag:
        ans += 1

print(ans)

# Optimized solution
# coding:utf-8

N = int(eval(input()))
P = [int(el) for el in input().split(' ')]
min_val = N+1
ans = 0

for p in P:
    if p < min_val:
        ans += 1
        min_val = p

print(ans)
# Original solution
import  heapq
n = int(eval(input()))
num = [int(i) for i in input().split()]
count1 = 0

for i in range(len(num)):
    num1 = num[:i+1].copy()
    heapq.heapify(num1)
    if heapq.heappop(num1) == num[i]:
        count1 += 1
        
print(count1)

# Optimized solution
n = int(eval(input()))
num = [int(i) for i in input().split()]
count1 = 0
minv = 0

for i in range(len(num)):
    if i ==0:
        count1 +=1
        minv = num[i]
        
    elif minv >= num[i]:
        minv = num[i]
        count1 +=1
print(count1)
# Original solution
n = int(eval(input()))
p = list(map(int,input().split()))
ans = 1
d = [1] + [0]*(n-1)
for i in range(1,n):
  if (p[i] <= p[i-1] and d[i-1] == 1):
    ans += 1
    d[i] = 1
  elif (d[i-1] ==0 and min(sorted(p[:i+1])) == p[:i+1][-1]):
    ans += 1
    d[i] = 1
    
print(ans)

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
ans = 0
m= 10**10

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

cnt = 0
tmp = []
for i in range(len(lst)):
    num = lst[i]
    tmp.append(num)
    if num == min(tmp):
        cnt += 1

print(cnt)


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

cnt = 0
tmp_min = max(lst)
for i in range(len(lst)):
    num = lst[i]
    if num <= tmp_min:
        cnt += 1
        tmp_min = num

print(cnt)
# Original solution
n = int(eval(input()))
seq = [int(e) for e in input().split(' ')]

count = 0
for i in seq:
  number_loop = len(seq[0:seq.index(i)+1])
  for idx, j in enumerate(seq[0:seq.index(i)+1]):
    if i > j:
      break
    if idx+1 == number_loop:
      count += 1
      
print(count)
      

# Optimized solution
n = int(eval(input()))
seq = [int(e) for e in input().split(' ')]

count = 1

current_min = seq[0]

for idx, i in enumerate(seq[1:]):
  if i < current_min:
    current_min = i
    count += 1
print(count)
# Original solution
n = eval(input())
p = input().split()

i_cnt = 1
current_max = {'idx': 0, 'value': 0}

for j in range(len(p)):
  for i in range(current_max['idx'], j):
    if current_max['value'] <= int(p[i]): 
      current_max['idx'] = i
      current_max['value'] = int(p[i])
    if int(p[i]) < int(p[j]):
      break
    if j-1 == i:
      i_cnt += 1

print(i_cnt)

# Optimized solution
n = eval(input())
p = input().split()

i_cnt = 1
current_max = {'idx': 0, 'value': 0}

for j in range(len(p)):
  for i in range(current_max['idx'], j):
    current_max['idx'] = i
    if current_max['value'] <= int(p[i]): 
      current_max['value'] = int(p[i])
    if int(p[i]) < int(p[j]):
      break
    if j-1 == i:
      i_cnt += 1

print(i_cnt)
# 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 = 1
m = P[0]
for i in range(1, N):
  if P[i] < m:
    m = P[i]
    count += 1
print(count)
# Original solution
n = int(eval(input()))
c = list(map(int,input().split(" ")))
ans = 0

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

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

# i=1 では必ず成り立つので i>=2 から調べる
s = 1
for i in range(1, N):
  flag = True
  for j in range(i):
    if P[j] < P[i]:
      flag = False
      break
  
  if flag: s += 1
    
print(s)

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

# 各時点での最小値を求める
m = [0]*(N)
m[0] = p[0]
for i in range(N-1):
  m[i+1] = min(m[i], p[i+1])

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

# 条件はN=O(10^5)より、本問はO(N)で解けるはず
# 二重ループをすると、O(N^2)で間に合わない
# 累積和の問題（ABC-154-Dとか）と同じ発想が使える！

# 具体的にO(N)で解くために、最初に各iに対して、i番目までの最小値を求めておく
m = [0]*(N)
m[0] = p[0]
for i in range(N-1):
  m[i+1] = min(m[i], p[i+1])

# 各iまでの最小値とi番目の値を比較し、最小値の方が大きければよい
ans = 1
for i in range(1, N):
  if m[i-1] >= p[i]: ans += 1
    
print(ans)

# Optimized solution
N = int(eval(input()))
p = list(map(int, input().split()))
 
# 条件はN=O(10^5)よりO(N)で解く
# 二重ループをすると、O(N^2)で間に合わない
# 累積和の問題（ABC-154-Dとか）と同じ発想が使える！
 
# 具体的にO(N)で解くために、最初に各iに対して、i番目までの最小値を求めておく
m = [0]*(N)
m[0] = p[0]
for i in range(1, N):
  m[i] = min(m[i-1], p[i])

# 各iまでの最小値とi番目の値を比較し、最小値の方が大きければよい
ans = 1
for i in range(1, N):
  if m[i-1] >= p[i]: ans += 1

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

cnt = 0
before_hairetsu = [N+1] * N

#i_before = N + 1
before_hairetsu[0] = N + 1
for i in range(N):
  if(min( min(before_hairetsu) , P[i]) >= P[i]):
    cnt += 1
  #i_before = P[i]
  before_hairetsu.append( P[i] )
  
print(cnt)
      

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

cnt = 0

maxmax = max(P) + 1

for i in range(N):
  if( maxmax > P[i]):
    cnt += 1
    maxmax = P[i]
  
print(cnt)
# Original solution
def main():
    N = int(eval(input()))
    P = [int(i) for i in input().split()]
    key = P[0]
    ans = 0
    for p in P:
        if p <= key:
            key = p
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    A = [int(i) for i in input().split()]
    m = 10**6
    ans = 0
    for a in A:
        if a <= m:
            m = a
            ans += 1
    print(ans)


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

count = 0
slist = []

for i in range(0,n):
    slist.append(list[i])
    if min(slist) == list[i]:
        count += 1
    else:
        pass

print(count)

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

count = 0
minn = xlist[0]

for i in range(0,n):
    if minn >= xlist[i]:
        count += 1
        minn = xlist[i]
    else:
        pass

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if p_list[i] > temp:
    continue
  if p_list[i] <= min(p_list[0:i+1]):
    j = j + 1
  else:
    temp = p_list[i]

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)
# Original solution
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    n = int(eval(input()))
    numbers=list(map(int,input().split()))
    count=0

    for idx,data in enumerate(numbers):
        if idx == 0:
            count+=1
        elif min(numbers[0:idx+1])==data:
            count+=1
        else:
            continue
    print(count)

if __name__=="__main__":
    main()

# Optimized solution
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    n = int(eval(input()))
    numbers=list(map(int,input().split()))
    small=0
    dp=[]

    for idx,data in enumerate(numbers):
        if idx == 0:
            small=data
            dp.append(data)
        elif data < small:
            small=data
            dp.append(data)
        else:
            continue
    print((len(dp)))

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

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


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

ans = 0
now_min = p_list[0]
for i in range(n):
    if now_min > p_list[i]:
        now_min = p_list[i]
    if p_list[i] <= now_min:
        ans += 1
print(ans)
# Original solution
n=int(eval(input()))
P=list(map(int,input().split()))
Q=[]
ans = 0
for i in range(n):
  Q.append(P[i])
  if P[i] == min(Q):
    ans += 1
print(ans)

# Optimized solution
n=int(eval(input()))
P=list(map(int,input().split()))
x=float("inf")
ans = 0
for i in range(n):
  if x > P[i]:
    ans += 1
    x = P[i]
print(ans)
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
b = 0
for x in range(len(a)):
    c = 0
    for y in range (x):
       if a[y] < a[x]:
           c +=1
    if c == 0:
        b+=1
print(b)


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
b = 0
mini = 2*(10**5)+10
for x in range(len(a)):
    if a[x] < mini :
        mini=a[x]
        b+=1
print(b)
# Original solution
n = int(eval(input()))
p_list = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    if all([p_list[i] <= p_list[j] for j in range(i)]):
        ans += 1
print(ans)


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

for i in range(n):
  list.append(p[i])
  if min(list)==p[i]:
    cnt+=1
    
print(cnt)

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
cnt=0
tiny=float('inf')

for i in range(n):
  if tiny>=p[i]:
    cnt+=1
    tiny=p[i]
  else:
    pass
    
print(cnt)
# Original solution
n=int(eval(input()))
p=list(map(int,input().split()))
cnt=0
tiny=float('inf')

for i in range(n):
  if tiny>=p[i]:
    cnt+=1
    tiny=p[i]
  else:
    pass
    
print(cnt)

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
cnt=0
tiny=float('inf')
for i in range(n):
  if tiny>=p[i]:
    cnt+=1
    tiny=p[i]
print(cnt)
# Original solution
import sys

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

answer = 0
for i in range(N):
    flag = True;
    
    for j in range(i):
        if P[i] > P[j]:
            flag = False
    
    if flag:
        answer += 1

print (answer)

# Optimized solution
import sys

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

answer = 0
prevMin = 2 ** 32
for i in range(N):
    if P[i] <= prevMin:
        answer += 1
        prevMin = P[i]

print (answer)
# Original solution
N = int(eval(input()))

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

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

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

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

cnt = 0
min_num = P[0]
for num in P:
  if num == min_num:
    cnt += 1
  elif num < min_num:
    cnt += 1
    min_num = num
  
print(cnt)
# Original solution
n = int(eval(input()))
P = list(map(int, input().split()))

counter = 0
for i in range(n):
  for j in range(i):
    if P[i] > P[j]:
      break
  else:
    counter += 1
print(counter)

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

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

num = 0
#print(min(P[:1]))
for k in range(0,N):
	if min(P[:k+1]) == P[k]:
		num+=1
print(num)

# Optimized solution
num = int(eval(input()))
A = list(map(int, input().split()))

a_min = 200001
count = 0
for a in A:
    if a < a_min:
        count += 1
        a_min = a

print(count)
# Original solution
n=int(eval(input()))
P=list(map(int,input().split()))
lst_con=[P[0]]
lst_num=[0]
s=0
for i in range(n):
  x=P[i]
  flag=True
  if x>lst_con[-1]:
    flag=False
  else:
    for j in range(lst_num[-1],i):
      if P[j]<x:
        flag=False
        break
  if flag:
    s+=1
print(s)


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

cnt=0
for i in range(N):
    min=p[0]
    for j in range(i):
        if min>=p[j]:
            min=p[j]
    
    if p[i]<=min:
        cnt+=1

print(cnt)

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

print(ans)

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

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


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

    if not flag:
        flag = True
    else:
        ans += 1 
print(ans)

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

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

# Optimized solution
n = int(eval(input()))
p = list(map(int,input().split()))
ans=0
m=[]
m.append(p[0])
for i in range(1,n):
    m.append(min(p[i],m[i-1]))

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

# Optimized solution
n=int(eval(input()))
p=list(map(int,input().split()))
a=p[0]
cnt=1
for i in p:
    if i<a:
        cnt+=1
        a=i
print(cnt)
# Original solution
n = int(eval(input()))
all_number = input().split()
count = 0
for i in range(n):
  check = True
  for j in range(i):
    if(int(all_number[i]) > int(all_number[j])):
      check = False
      break
  if(check):
    count = count + 1
print(count)

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

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

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

s = 10**18
ans = 0

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