CodeEff/ECCO huggingface dataset:
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))
A=[]
ans=0
for i in P:
    A.append(i)
    if min(A)==i:
        ans+=1
print(ans)

# Optimized solution
N=int(eval(input()))
P=list(map(int,input().split()))
A=10**100
ans=0
for i in P:
    A=min(A,i)
    if A==i:
        ans+=1
print(ans)
# Original solution
n1 = int(eval(input()))

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

r1 = 0

for i1 in range(n1):
    if i1 == 0:
        r1 += 1 
        continue
    t1 = n2[0: i1]
    t1.sort()
    if t1[0] > n2[i1]:
        r1 += 1

print(r1)


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

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

r1 = 0
m1 = n1 + 1

for i1 in range(n1):
    if n2[i1] < m1:
        r1 +=1
        m1 = n2[i1]

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


# Optimized solution
n = int(eval(input()))
p_n = list(map(int, input().split()))
ans = 1
p_i_1 = [p_n[0]]
m = p_n[0]
for i in range(1, n):
    if m > p_n[i]:
        ans += 1
    m = min(m, p_n[i])
    p_i_1.append(p_n[i])
    if m == 1:
        break
print(ans)
# Original solution
from sys import stdin
N=int(eval(input()))
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)

# Optimized solution
from sys import stdin
N=int(eval(input()))
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=1
min=P[0]

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

cnt = 0
for i in range(N):
    Flg = True
    for j in range(i+1):
        if P[j] < P[i]:
            Flg = False
            break
    if Flg:
        cnt += 1
print(cnt)


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

cnt = 0
min_value = N + 1
for i in range(N):
    if P[i] <= min_value:
        cnt += 1
        min_value = P[i]
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
T = [0]*N
ans = 0

for i in range(N):
    T[i] = min([P[0]]+P[:i])

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

print(ans)

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
T = [P[0]]+[10**10]*(N-1)
ans = 0

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

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

print(ans)
# Original solution
N = int(eval(input()))
P = list(map(int,input().split()))
k=0
l=0
for i in range(N):
    for j in range(i+1):
        if P[i]<=P[j]:
            k+=1
        if k ==i+1:
            l+=1
    k=0
print(l)

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

count = 0

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

print(count)

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

count = 0

minimum = Ps[0]

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

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

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

if __name__ == "__main__":
    resolve()

# Optimized solution
def resolve():
    N = int(eval(input()))
    arr = tuple(map(int, input().split()))
    tmp = arr[0]
    counter = 0
    for i in arr:
        if i<=tmp:
            tmp=i
            counter += 1
    print(counter)

if __name__ == "__main__":
    resolve()
# Original solution
N = int(eval(input()))
P = b = list(map(int, input().split()))

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

print(ans)


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

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

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

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


# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
c = 0

x=a[0]

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

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

print(cnt)

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

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

print(ans)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))  
B = [None]*N

for i in range(N):
  if all([A[v] >= A[i] for v in range(i)]): 
    B[i]=True
  else:
    B[i]=False

print((B.count(True)))


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

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

print(cnt)
# Original solution
N=int(eval(input()))
P=list(map(int,input().split()))
def m(n):
    return min(P[:n+1])
A=[]
for i in range(N):
    A.append(m(i))
print((len(set(A))))

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

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

print(ans)

# Optimized solution
N=int(eval(input()))
data = list(map(int, input().split()))
ans=1
minmin=data[0]
if N==1:
    ans=1
elif N>1:
    minmin=data[0]
    for i in range(1,N):

        if data[i]<=minmin:
            minmin=data[i]
            #if minmin<=data[i]:
            ans+=1
                #continue
        #if minmin<=data[i]:
            #ans+=1

print(ans)
# Original solution

def main():
    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)

if __name__ == "__main__":
    main()

# Optimized solution

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

if __name__ == "__main__":
    main()
# Original solution
n, *p_n = list(map(int, open(0).read().split()))

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

# Optimized solution
n, *p_n = list(map(int, open(0).read().split()))

count = 0
p_n_min = p_n[0]
for i in range(n):
    p_n_min = min(p_n_min,p_n[i])
    if p_n_min == p_n[i]:
        count += 1
print(count)
# Original solution
n, *p_n = list(map(int, open(0).read().split()))

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

# Optimized solution
n, *p_n = list(map(int, open(0).read().split()))

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

# Optimized solution
n = int(eval(input()))
P = list(map(int, input().split()))
c = 0
for i in range(n):
  if i ==0: 
    c+=1
    current_min = P[i]
  elif P[i] < current_min: 
    c +=1
    current_min = P[i]
print(c)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
p_min = []
for ind in range(1,n+1):
    p_min.append(min(p[:ind]))
# print(p_min)
cnt = 0
for ind in range(n):
    if p[ind] <= p_min[ind]:
        cnt += 1  
print(cnt)


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

ans = 0

for i in range(n):
    #i番目までのリストを作成
    check_part = p_list[:i+1]
    #その中で一番小さいかどうか
    if p_list[i] == min(check_part):
        ans += 1

print(ans)

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

ans = 0
min = n + 1

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

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

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
mi = 10**7
b = [0]*N
for i in range(N):
    if mi > P[i]:
        b[i] += 1
        mi=P[i]
print((sum(b)))
# Original solution
n = int(eval(input()))
seq = list(map(int,input().split()))
ans = 1

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

print(ans)

# Optimized solution
n = int(eval(input()))
seq = list(map(int,input().split()))
ans = 1
minim = n

for i in range(1, n):
    minim = min(minim, seq[i-1])
    if minim > seq[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 min(p[i],min(p[:i])) == p[i]:
    count+=1
print(count)



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

count = 1
for i in range(1, N):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        count = count + 1

print(count)

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

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

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

# Optimized solution
eval(input())
p0, *P = list(map(int, input().split()))
cnt = 1
curr = p0
for p in P:
    if p < curr:
        cnt += 1
        curr = p
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))

ans = 0
for i, j in enumerate(P):
    if min(P[:i + 1]) >= j:
        ans += 1

print(ans)

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

ans = 0
p_min = P[0]
for i, j in enumerate(P):
    if p_min >= j:
        ans += 1
        p_min = j

print(ans)
# Original solution
n = int(eval(input()))
p_ls = list(map(int, input().split()))
sum_=0
for i in range(0,n):
  j=0
  if i==0: max_,min_=p_ls[i],p_ls[i]
  #print('%d %d'%(i,j))
  #print(max_)
  while j<=i:
    if min_>p_ls[i]: 
      min_=p_ls[i]
      break
    elif max_<p_ls[i]:
      max_=p_ls[i]
      sum_-=1
      break
    elif p_ls[j]<p_ls[i]:
      sum_-=1
      break
    j+=1
  sum_+=1
print(sum_)

# Optimized solution
n = int(eval(input()))
p_ls = list(map(int, input().split()))
sum_=1
min_=p_ls[0]
for i in range(1,n):
  if min_>=p_ls[i]:
    min_=p_ls[i]
    sum_+=1
print(sum_)
# Original solution
def main():
    import sys
    N = int(eval(input()))
    input_2 = sys.stdin.readline
    P_list = list(map(int,input_2().split()))
    i_num = 0
    for i in range(N):
        if P_list[i] <= min(P_list[:i+1]):
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()

# Optimized solution
N = int(eval(input()))
P_list = list(map(int,input().split()))
i_num = 0
min_P = P_list[0]
for p in P_list:
    if p <= min_P:
        min_P = p
        i_num += 1
print(i_num)
# Original solution
def main():
    N = int(eval(input()))
    P_list = list(map(int,input().split()))
    i_num = 0
    min_P = P_list[0]
    for p in P_list:
        if p <= min_P:
            min_P = p
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    import sys
    N = int(eval(input()))
    input_2 = sys.stdin.readline
    P_list = list(map(int,input_2().split()))
    i_num = 0
    min_P = P_list[0]
    for p in P_list:
        if p <= min_P:
            min_P = p
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()
# Original solution
N = int(eval(input()))
array = list(map(int, input().split()))
cnt = 0

for i in range(0, N):
    array2 = list(array[0:i+1])
    array2.sort()
    if array2[0] == array[i]:
        cnt += 1
print(cnt)

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

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
# P = np.array(input().split(' '), dtype = int)
P = list(map(int, input().split(' ')))

ar_bool = [(min(P[:i+1]) == P[i]) for i in range(N)]
print((sum(ar_bool)))

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

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

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split(' ')))
cnt = 1
j = P[0]
for i in range(1, N):
    j = min(j, P[i])
    if P[i] <= j:
        cnt += 1
print(cnt)
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    partP = P[:i+1]
    flag = True 
    partP = sorted(partP)[::-1]
    for p in partP:
        if P[i] <= p:
            continue
        else:
            flag = False
            break
    if flag:
        ans += 1

print(ans)


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

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


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

while True:
    if tmpMinIndex == 0:
        break
    li = li[0:tmpMinIndex]
    minNum = min(li)
    tmpMinIndex = li.index(minNum)
    count += 1


print(count)

# Optimized solution
n = int(eval(input()))
li = list(map(int, input().split()))
tmpMin = li[0]
count = 0

for i in range(n):
    if li[i] <= tmpMin:
        tmpMin = li[i]
        count += 1

print(count)
# Original solution
from collections import deque
n=int(eval(input()))
p=list(map(int,input().split()))
cnt=0
s=deque()
for i in p:
  s.append(i)
  if min(s)==i:
    cnt+=1
print(cnt)

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

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

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

c = 1
pmin = 1000000
for i in range(1,N):
    if P[i-1]<pmin:
        pmin = P[i-1]
    if pmin >= P[i]:
        c += 1
print(c)
# Original solution
n=int(eval(input()))
l=[int(i) for i in input().split()]
c=0
for i in range(n):
  c1=min(l[:i+1])
  if(l[i]==c1):
    c+=1
print(c)

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


cut = N
check =0
min = N

for i in range(1,N+1):
    
    if List[i-1]<=min:
        min = List[i-1]
        
        for k in range(1,i+1):
            if List[k-1]<List[i-1]:
                check = 1
                break
        if check==1:
            cut -= 1
        check = 0

    else:
        cut -=1

    




print(cut)

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


cut = N
check =0
min = N

for i in range(1,N+1):
    
    if List[i-1]<=min:
        min = List[i-1]
        
    else:
        cut -=1

    




print(cut)
# Original solution
n, = (int(x) for x in input().split())
p = list(int(x) for x in input().split())

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

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


def f(l):
    left = 0
    right = i + 1
    while left + 1 < right:
        x = (left + right) // 2
        if test(x):
            left = x
        else:
            right = x


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


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

ans = 0
v = P[0]
for i in P:
    if i <= v:
        ans += 1
        v = i
print(ans)
# Original solution
def main():
    N = int(eval(input()))
    P = list(map(int,input().split()))
    cnt = 1
    for i in range(1, N):
        # Pi
        # P[0:i]
        Q = P[0:i]
        if P[i] > min(P[0:i]):
            cnt = cnt
        else:
            cnt += 1

        #Q = [ _ for _ in P[0:i] if P[i] <= _ ]  # TLE
        #for _ in P[0:i+1]:
        #    print(_)
        #if len(Q) == i:
        #    cnt += 1
    print(cnt)

main()

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

main()
# Original solution
n=int(eval(input()))
p=list(map(int, input().split()))
count=1
if not n==1:
  for i in range(1, n):
    for j in range(i):
      if not p[i] <= p[j]:
        break
      elif j==i-1:
        count+=1
  print(count)
else:
  print((1))

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

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

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

ans = 0
m = 10**10

for p in p_list:
    if p <= m:
        ans += 1
        m = p
print(ans)
# Original solution
n = int(eval(input()))
p = list([int(x) for x in input().split()])

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

print(count)


# Optimized solution
n = int(eval(input()))
p = list([int(x) for x in input().split()])

min_list = [p[0]]
count = 1
for i in range(1,n) :
    if p[i] < min_list[i - 1] :
        min_list.append(p[i])
    else :
        min_list.append(min_list[i - 1])

for j in range(1,n) :
    if p[j] <= min_list[j - 1] :
        count += 1

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


# Optimized solution
n=int(eval(input()))
ps=list(map(int,input().split()))
cnt=0
max_=ps[0]
min_=ps[0]
for p in ps:
    if min_>=p:
        cnt+=1
        min_=p
print(cnt)
# 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[0:i])):
        count+=1
    else:
        pass
print(count)

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

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

# Optimized solution
N = int(eval(input()))
P = list(map(int, input().split()))
Q = [P[0]]
for i in P[1:]:
    if i < Q[-1]:
        Q.append(i)
print((len(Q)))
# Original solution
N = int(eval(input()))
P = list(map(int, input().split()))
ans = 1

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

print(ans)

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

for num in P:
    if num <= lowest:
        ans += 1
    lowest = min(lowest, num)

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

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


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

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

print(ans)
# Original solution
N = int(eval(input()))
P = [int(p_) for p_ in input().split()]

ans = [1]
for i in range(1, len(P)):
    #print(i+1, P[0:i], min(P[0:i]), P[i])
    if P[i] <= min(P[0:i]):
        ans.append(i+1)
        
print((len(ans)))

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

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

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

# Optimized solution
N=int(eval(input()))
list=list(map(int,input().split()))
A=1
i=0
j=0
for x in range(N):
  if list[i]<list[j]: 
      A=A+1
      j=i
  i=i+1
print(A)