CodeEff/ECCO huggingface dataset:
# 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
current = max(p)+1
for i in range(n):
  if p[i]  <= current:
    current = p[i]
    ans +=1
  
#  if p[i] == min(p[:i+1]):
#        ans+=1 
                 
print(ans)
# Original solution
a = int(eval(input()))
b = list(map(int, input().split()))
n = 0
for i in range(0,a):
    l = 0
    for j in range(0,i):
               if b[i] <= b[j]:
                    l += 1
    if l == i:
        n += 1
print(n)

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

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


if __name__ == '__main__':
    main()



# Optimized solution

def main():
    
    n = int(eval(input()))
    p_list = list(map(int, input().split()))
    
    ans = 1
    tmp = p_list[0]
    for i in range(n-1):
        if tmp >= p_list[i+1]:
            ans += 1
            tmp = p_list[i+1]
    
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_right

sys.setrecursionlimit(10**7)
N = int(eval(input()))
P = list(map(int, input().split()))

rP = list(reversed(P))

cnt = 0
for i, rp in enumerate(rP):
    for val in rP[i+1:]:
        if rp > val:
            break
    else:
        cnt += 1

print(cnt)


# Optimized solution
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_right

sys.setrecursionlimit(10**7)
N = int(eval(input()))
P = list(map(int, input().split()))

cnt = 0
minv = P[0]
for p in P:
    minv = min(minv, p)
    if p == minv:
        cnt += 1

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

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

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


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

res = 0
mini = P[0]
for i in range(N):
    mini = min(mini, P[i])
    if(mini >= P[i]):
        res += 1
print(res)
# Original solution
n=int(eval(input()))
b=list(map(int,input().split()))
count=1
temp=[b[0]]
for i in range(1,n):
  temp.append(b[i])
  if b[i]==min(temp):
    count=count+1  
print(count)

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

# Optimized solution
N = int(eval(input()))
P = list(map(int,input().split()))
result = 1
mini = P[0]
for i in P:
    if mini > i:
        result += 1
        mini = i
print(result)
# Original solution
n = int(eval(input()))
numbers = list(map(int, input().split(' ')))
counter = 0

for i in range(n):
    flag = True
    for j in range(i):
        if numbers[i] > numbers[j]:
            flag = False
    if flag is True:
        counter += 1
print(counter)

# Optimized solution
n = int(eval(input()))
numbers = list(map(int, input().split(' ')))
counter = 0
min_value = numbers[0]
for number in numbers:
    if number <= min_value:
        counter += 1
        min_value = number

print(counter)
# 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
m=P[0]
 
for i in range(N):
    if m >= P[i]:
        ans += 1
        m = P[i]

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

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

answer = 0
for i in range(len(p_li)):
    count_flag = True
    for j in range(i):
        if p_li[i] <= p_li[j]:
            continue
        else:
            count_flag = False
            break
    if count_flag:
        answer += 1

print(answer)


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

answer = 0
now_min = 999999
for i in range(len(p_li)):
    if now_min > p_li[i]:
        now_min = p_li[i]
        answer += 1

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

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


# Optimized solution
n = int(eval(input()))
P = list(map(int, input().split()))
c = 1
minv = P[0]  # その数より左にあるかずは全大きくさくなければならない
for i in range(1, len(P)):
    if minv > P[i]:
        c += 1
    minv = min(minv, P[i])
print(c)
# Original solution
if __name__ == '__main__':
    n = int(eval(input()))
    p = list(map(int, input().split(" ")))

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

    print(count)

# Optimized solution
if __name__ == '__main__':
    n = int(eval(input()))
    p = list(map(int, input().split(" ")))

    count = 0
    min_num = 10000000
    for i in p:
        if i < min_num:
            count = count + 1
            min_num = i

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

    n = 0
    x = 10 ** 20
    for i in range(N):
      if x < P[i]:
        continue
      else:
        x = P[i]
        for j in range(i):
            if P[i] > P[j]:
                break
        else:
            n += 1
    print(n)

resolve()

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

    n = 0
    x = 10 ** 20
    for i in range(N):
        if x >= P[i]:
            x = P[i]
            n += 1
    print(n)

resolve()
# Original solution
N=int(eval(input()))
x=list(map(int,input().split()))

counter=0
flag=True

for i in range(N):
    a=x[i]
    for j in range(i+1):
        if flag==False:
            continue
        if a>x[j] and flag:
            counter+=1
            flag=False


    flag=True
print((N-counter))


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

counter=0
flag=True
#最小値
a=x[0]
for i in range(N):

    if a>x[i] :
        a=x[i]
    if a<x[i]:
        counter+=1

print((N-counter))
# Original solution
N = int(eval(input()))
A = list(map(int,input().split()))

cnt = 1
for i in range(1,N):
    for j in range(0,i):
        if A[i] > A[j]:
            break
    else:
        cnt += 1
print(cnt)

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

cnt = 0
# for i in range(1,N):
#     for j in range(0,i):
#         if A[i] > A[j]:
#             break
#     else:
#         cnt += 1
min_value = A[0]
for i in range(N):
    if min_value >= A[i]:
        cnt += 1
        min_value = A[i]

print(cnt)
# Original solution
n = int(eval(input()))
p = [int(i) for i in input().split()]

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

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

score = 1
m = p[0]
for i in range(1,n):
  m = min(m, p[i-1])
  if m >= p[i]:
    score += 1
    
print(score)
# 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()))
ans = 0
minimum = n

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

print(ans)
# Original 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:
        min = P[i]
        count += 1

print(count)

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

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

main()
# Original solution
loop = int(eval(input()))
num_list = list(map(int, input().split()))
ans = 0
for idx, n in enumerate(num_list):
  flg = True
  if idx > 0:
    for m in num_list[: idx]:
      if m < n:
        flg = False
        break
  if flg:
    ans += 1
print(ans)

# Optimized solution
loop = int(eval(input()))
num_list = list(map(int, input().split()))
ans = 0
min_value = 20000000
for n in num_list:
  flg = True
  if min_value < n:
    flg = False
  else:
    min_value = n
  if flg:
    ans += 1
print(ans)
# Original solution
# -*- coding: utf-8 -*-
 
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
# -*- coding: utf-8 -*-
 
N = int(eval(input()))
P = list(map(int, input().split()))

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

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

print(num)

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

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

print(ans)
# Original solution
def function(p, i):
  a = p[i]
  amin = min(p[:i+1])
  if amin == a:
    return 1
  else:
    return 0
 
n = int(eval(input()))
p = list([int(x) for x in input().split()])
sums = sum([function(p,i) for i in range(n)])
print(sums)

# Optimized solution
n = int(eval(input()))
p = list([int(x) for x in input().split()])
 
count = 0
maxs = p[0]
for i in range(n):
  if maxs >= p[i]:
    maxs = p[i]
    count += 1
print(count)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split())) 
correct_answer_count = 0
for i in range(N):
    bat_answer_count = 0
    for j in range(i):
        if len(A) < j:
            continue
        if not (A[i] <= A[j]):
            bat_answer_count += 1

    if bat_answer_count == 0:
        correct_answer_count += 1

print(correct_answer_count)    


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

for i in range(1,len(pn)):
    if min(pn[:i]) > pn[i]: count += 1
print(count)


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

for i in range(1,len(pn)):
    if min > pn[i - 1]: min = pn[i - 1]
    if min > pn[i]: count += 1
print(count)
# Original solution
import sys
input = sys.stdin.readline
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
import sys
input = sys.stdin.readline
N=int(eval(input()))
P=list(map(int,input().split()))
count = 0
saisyouti = P[0]
for i in range(N):
    if P[i]<=saisyouti:
        count += 1
        saisyouti=P[i]
print(count)
# Original solution
# coding: utf-8
# Your code here!

from collections import deque

N = int(eval(input()))
P = deque(list(map(int, input().split())))
ctr = 0
Array = []

for i in range(N):
    Array.append(P.popleft())
    if Array[-1] == min(Array):
        ctr += 1
print(ctr)

# Optimized solution
# coding: utf-8
# Your code here!

from collections import deque

N = int(eval(input()))
P = deque(list(map(int, input().split())))
ans, tmp, minnum = 0, 0, pow(10,9)
Array = []

for i in range(N):
    tmp = P.popleft()
    Array.append(tmp)
    if tmp < minnum:
        minnum = tmp
    if Array[-1] == minnum:
        ans += 1
print(ans)
# Original solution
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(eval(input()))
#  = map(int, input().split())
p  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

print(ans)



# Optimized solution
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(eval(input()))
#  = map(int, input().split())
p  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

ans = 0
min_ = 10**9
for i in range(n):
    if p[i] < min_:
        ans += 1
        min_ = p[i]

print(ans)
# Original solution
N=int(eval(input()))
Pn=[]
P=input().split()
for p in P:
    Pn.append(int(p))

count=1
nowmin=Pn[0]

for i in range(1,len (Pn)):
    targetArr=Pn[:i]
    if Pn[i]<nowmin:
        count+=1
        nowmin = Pn[i]
    
print(count)


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

count=1
nowmin=Pn[0]

for i in range(1,len(P)):
    if int(P[i])<nowmin:
        count+=1
        nowmin = int(P[i])
    
print(count)
# Original solution
n = int(eval(input()))
p = [int(i) for i in input().split()]

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

print(ans)

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

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

print(ans)
# Original solution
N = int(eval(input()))
p = list(map(int,input().split()))
cou1 = 0
cou2 = 0
num1 = min(p)
num2 = p.count(num1) 


for i in range(N):
    num3 = min(p[0:i+1])
    if p[i] == num3:
        cou1 += 1
    if p[i] == num1:
        cou2 += 1
    if cou2 == num2:
        break
    
print(cou1)
    

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

cou = 0
x = math.inf

for j in range(N):
    if min(x,p[j]) == p[j]:
        x = p[j]
        cou += 1

print(cou)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
#n = 4
#p = [4,3,2,1]

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

# Optimized solution
n = int(eval(input()))
p = list(map(int, input().split()))
#n = 5
#p = [4,2,5,1,3]

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

x=0
y=[]
z=l[0]
for i in range(n):
    #y=y+[l[i]]
    z=min(z,l[i])
    if l[i]<=z:
        x+=1
print(x)
    






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

x,y=0,l[0]
for i in range(n):
    y=min(y,l[i])
    if l[i]<=y:
        x+=1

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

count = 0
for i in range(1, n+1):
  if i in set(P):
    count += 1
    P = P[:P.index(i)]
  if len(P) == 0:
    break

print(count)

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

count = 0
tmpmin = P[0]
for p in P:
  if p <= tmpmin:
    count += 1
    tmpmin = p

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

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

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

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

# Optimized solution
N=int(eval(input()))
P=list(map(int,input().split()))
count=0
P_new=[]
for index in range(N):
    P_new.append(P[index])
    if P_new[0]>P_new[index]:
        P_new[0]=P_new[index]
    if P_new[0]==P[index]:
        count+=1
print(count)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

aa = list(reversed(A))

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



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

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

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

ans = N - count
print(ans)

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

M = N+1
ans = 0

for i in range(1, N+1):
  if M > A[i-1]:
    M = A[i-1]
    ans += 1

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

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

cnt = 0
for i, n in enumerate(numbers):
    if min(numbers[:i+1]) == n:
        cnt += 1
    if n == 1:
        break
        
print(cnt)

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

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

cnt = 0
min_num = numbers[0]
for i, n in enumerate(numbers):
    if min_num >= n:
        cnt += 1
        min_num = n
    
    if n == 1:
        break
        
print(cnt)
# Original solution
N=int(eval(input()))
p=list(map(int,input().split()))

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

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

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

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


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

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

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

l = [int(i) for i in tl]

mn = n

count = 0
for i in range(len(l)):
    if l[i] > mn:
        continue

    sl = l[0:i+1]
    mn = min(sl)
    count += 1

print(count)


# Optimized solution
n = int(eval(input()))
tl = input().split()

l = [int(i) for i in tl]

mn = n

count = 0
mn_i = 0
for i in range(len(l)):
    if l[i] > mn:
        continue

    sl = l[mn_i:i+1]
    mn = min(sl)
    mn_i = i
    count += 1

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

# Optimized solution
n=int(eval(input()))
A=list(map(int,input().split()))
cnt=0
x=A[0]
for i in range(n):
    if A[i]<=x:
        cnt+=1
        x=min(x,A[i])
print(cnt)
# 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[i]>P[j]):
            break
        elif(i == j + 1):
            count+=1

print(count)



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

Pmin = float("inf")
count = 0
for i in P:
    if i < Pmin:
        Pmin = i
        count += 1

print(count)
# Original solution
n = int(eval(input()))
p = list(map(int, input().split()))
p_list = [True for i in range(n)]
for i in range(1,n):
    for j in range(i):
        if p[i] > p[j]:
            p_list[i] = False
            break
print((p_list.count(True)))

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

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

print(ans)


# Optimized solution
n = int(eval(input()))
p_list = list(map(int, input().split()))
min_num = p_list[0]
ans = 1

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

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

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

print(ans)

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

ans = 0
m = 10 ** 6
for i in range(N):
    if P[i] <= m:
        ans += 1
        m = P[i]

print(ans)