peterverebics/CodeNet_Python_118 huggingface dataset:
a=int(input())
b=list(map(int,input().split()))
b_max=b[0]
total=0
for i in range(1,a):
    if b[i]<=b_max:
        total+=1
        b_max=b[i]
print(total+1)
N = int(input())
P = list(map(int, input().split()))

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

print(ans)
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(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)
N = int(input())
P = list(map(int, input().split()))

mn = N + 1
ans = 0
for p in P:
    if p < mn:
        ans += 1
    mn = min(mn, p)
print(ans)
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

# a,b = map(int, input().split())
n = int(input())
p = list(map(int,input().split()))

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

print(count)
N=int(input())
P=list(map(int,input().split()))
min_p=P[0]
cnt=0
for i in range(N):
    if min_p>=P[i]:
        min_p=P[i]
        cnt+=1
print(cnt)
words = lambda t : list(map(t, input().split()))
n = int(input())
xs = words(int)
minx = n+1
ans = 0
for i in range(n):
    if xs[i] < minx:
        minx = xs[i]
        ans += 1
print(ans)
n = int(input())
p = list(map(int, input().split()))
 
mini = 1 << 18
cnt = 0
for i in range(len(p)):
    if p[i] <= mini:
        cnt+=1
        mini = p[i]
 
print(cnt)
n = int(input())
p = list(map(int,input().split()))
mn = 2*10**5+1
count = 0
for i in range(n):
  if p[i] < mn:
    count += 1
    mn = p[i]
print(count)
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


def fetch_ints_inputs(times):
    return [fetch_int_input() for _ in range(times)]

N = int(fetch_one_line())
nums = fetch_int_input()

min_num = 999999999999999999
count = 0

for num in nums:
    if min_num >= num:
        count += 1
        min_num = num

print(count)
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

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

print(ans)
n = int(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)
a = int(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)
n = int(input())
P = list(map(int, input().split(' ')))

count = 0
minimum = 2 * 10 ** 5 + 1
for p in P:
    if p < minimum:
        count += 1
        minimum = p
print(count)
n = int(input())
p = list(map(int, input().split()))

s = 1
t = p[0]
for i in range(1,n):
  if p[i] <= t:
    s += 1
    t = p[i]
print(s)
def readinput():
    n=int(input())
    p=list(map(int,input().split()))
    return n,p

def main(n,p):
    count=0
    pmin=p[0]
    for i in range(n):
        pmin=min(p[i],pmin)
        if pmin>=p[i]:
            count+=1
    return count

if __name__=='__main__':
    n,p=readinput()
    ans=main(n,p)
    print(ans)
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)
n = int(input())
ls = list(map(int,input().split()))
min = ls[0]
k = 1
for i in range(1,n):
    if ls[i] < min:
        min = ls[i]
        k += 1
print(k)
n = int(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)
n = int(input())
a = tuple(map(int,input().split()))

res = 0
mi = 10**20
for e in a:
    if mi > e:
        res += 1
        mi = e
print(res)
import math

N = int(input())

tmp = 10 ** 30
ans = 0
for P in list(map(int,input().split())):
    if P <= tmp:
        tmp = P
        ans += 1

print(ans)
n=int(input())
p=[]*n
p=list(map(int,input().split()))
cnt=0
com=p[0]
for i in range(n):
    if com>=p[i]:
        cnt+=1
    com=min(com,p[i])
print(cnt)
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	P = getlist()
	S = [0] * N
	S[0] = P[0]
	for i in range(1, N):
		S[i] = min(S[i - 1], P[i])
	# print(S)
	ans = 0
	for i in range(N):
		if S[i] >= P[i]:
			ans += 1
	print(ans)
	
if __name__ == '__main__':
	main()
N=int(input())
P=list(map(int,input().split()))
cnt,minimum=0,max(P)
for i in range(N):
    if P[i]<=minimum:
        cnt+=1
        minimum=P[i]
print(cnt)
N = int(input())
P = list(map(int,input().split()))
m = N + 1
ans = 0
for i in P:
  if i <= m:
    ans += 1
    m = i
  else:
    continue
print(ans)
from sys import stdin
n = int(stdin.readline())
l = list(map(int,stdin.readline().split()))
ans = 0
m = float('inf')
for u in l:
	if u<=m: m = u; ans += 1
print(ans)
n = int(input())
p = list(map(int,input().split()))

count = 1
num = p[0]
for i in range(1,len(p)):
    if p[i] <= num:
        count += 1
        num = p[i]
        
print(count)
_ = input()
P = [int(i) for i in input().split()]

vmin = max(P)
vmax = 0

cnt = 0
for p in P:
  if p <= vmin:
    cnt += 1
  if p < vmin:
    vmin = p
  if vmax < p:
    vmax = p
    
print(cnt)
n = int(input())
a = list(map(int,input().split()))

pf = [0]*n
mn = 1e9
for i in range(0,n):
    mn = min(mn,a[i])
    pf[i] = mn
    
cn = 0
for i in range(n):
    if(a[i]<=pf[i]):
        cn += 1
        
print(cn)
n=int(input())
P=list(map(int,input().split()))
ans=0
minp=n+1
for i in range(n):
    minp=min(minp,P[i])
    if minp==P[i]:
        ans+=1
print(ans)
N = int(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)
n = int(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)
N = int(input())
P = list(map(int, input().split()))

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

print(ans)
n = int(input())
p = [int(x) for x in input().split()]

cnt=1
saisyouti=p[0]
for i in range(1,n):
    if p[i]<saisyouti:
        cnt+=1
        saisyouti=p[i]

print(cnt)
N=int(input())
P=map(int, input().split())
ans=0
mv=N
for p in P:
    if p<=mv:
        ans+=1
        mv=p
print(ans)
N=int(input())
P=list(map(int,input().split()))
ans=0
mini=10**6
for p in P:
    if p<=mini:
        mini=p
        ans+=1
print(ans)
def read():
    N = int(input().strip())
    P = list(map(int, input().strip().split()))
    return N, P

def solve(N, P):
    min_value = P[0]
    count = 0
    for i in range(N):
        min_value = min(min_value, P[i])
        if P[i] == min_value:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))
a = int(input())
s = list(map(int, input().split()))
min_val = 3 * 10 ** 5
count = 0
for i in s:
  if min_val >= i:
    count += 1
  min_val = min(min_val, i)
print(count)
import numpy as np

n = int(input())
P = np.array(list(map(int, input().split())))
T = np.zeros(n)
T[0] = P[0]
for i in np.arange(1,n,1):
    T[i] = min(T[i-1], P[i])
print(np.sum(P==T))
import sys
input = sys.stdin.readline

n=int(input())
L=list(map(int,input().split()))
MIN = 1<<30
ans = 0
for i in L:
    MIN = min(MIN,i)
    if i<=MIN:
        ans+=1
print(ans)
N = int(input())
P = list(map(int,input().split()))

count =0
mi= 3*(10**5) 
for i in range(N):
    if mi >= P[i]:
        count +=1
        mi=P[i]

print(count)
n=int(input())
#n,p=map(int,input().split())
pl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

mn=pl[0]

mnl=[]
count=1
for i in range(n):
    mn=min(mn,pl[i])
    mnl.append(mn)

for i in range(1,n):
    if pl[i]<=mnl[i-1]:
        count+=1
print(count)
n = int(input())
p = list(map(int, input().split()))

count = 0
minimun = 2 * (10**5)+1

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

print(count)
n=int(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)
N = int(input())
P = list(map(int,input().split()))
minimum = P[0]
cnt = 0
for number in P:
    if number <= minimum:
        cnt += 1
        minimum = min(minimum,number)
print(cnt)
N = input()
P = input().split()

N = int(N)
P =[int(p) for p in P] 


count = 0

minimum=N

for i in range(N):
    if minimum >= P[i]:
        count+=1
        minimum = P[i]
        if minimum == 1:
            break
        
    
print(count)
n=int(input())
p=[int(i) for i in input().split()]
b=p[0]
ans=1
for i in range(1,n):
  if p[i]<b:
    b=p[i]
    ans+=1
print(ans)
n = int(input())
p = [int(i) for i in input().split()]
count = 0
point_min = p[0]
for i in p:
    if i <= point_min:
        count += 1
        point_min = i
print(count)
N = int(input())

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

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

print(count)
n=int(input())
p=list(map(int,input().split()))
m=10**6
ans=0
for i in p:
  if m>i:
    m=i
    ans+=1
  
print(ans)
N = int(input())
P = list(map(int, input().split()))

cnt = 0
a = P[0]
for x in P:
    if x <= a:
        cnt += 1
        a = x

print(cnt)
def acinput():
    return list(map(int, input().split(" ")))

N=int(input())
P=acinput()

minv=10**6

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

print(count)
n = int(input())
pl = list(map(int, input().split()))

min_num = 1001001001
ans = 0
for p in pl:
    if p <= min_num:
        ans += 1
        min_num = p

print(ans)
import numpy as np
n = int(input())
p = np.array(list(map(int, input().split())))
ans = 1
min_n = p[0]
for i in range(1, n):
    min_n = min(min_n, p[i-1])
    if p[i] <= min_n:
        ans += 1
print(ans)
#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

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

    mi = 1000000000
    cnt = 0
    for i in range(n):
        if p[i] <= mi:
            cnt += 1
        if mi > p[i]:
            mi = p[i]
    print(cnt)

main()
n = int(input())
p = list(map(int, input().split()))
c = p[0]
ans = 0
for i in range(n):
    if min(c, p[i]) == p[i]:
        ans += 1
        c = p[i]
print(ans)
N = int(input())

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

cnt = 1
min_num = p_list[0]

for i in range(1, N):
    if p_list[i] <= min_num:
        cnt += 1
        min_num = p_list[i]

print(cnt)
n=int(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)
n=int(input())
x=[int(k) for k in input().split()]
count=0
max=n+1
for i in range(0,len(x)):
    if max>x[i]:
        count+=1
        max=x[i]
print(count)
N=int(input())
List=list(map(int,input().split()))
count=0
min=float("inf")
for i in range(N):
    if List[i]<=min:
        count+=1
        min=List[i]

print(count)
n=int(input())
p=list(map(int, input().split()))

ans=1
minn=p[0]
for i in range(1,n):
  minn = min(p[i-1], minn)
  if minn >= p[i]: 
    ans+=1
print(ans)
n = int(input())
p = list(map(int, input().split()))

count = 0
m = p[0]

for i in p:
    m = min(m, i)
    if m == i:
        count += 1
print(count)
def Main(N, P):
    ans = 1
    mi = P[0]
    for i in range(1, N):
        if mi > P[i]:
            ans += 1
            mi = P[i]
    return ans

def main():
    N = int(input())
    P = list(map(int, input().split()))
    print(Main(N, P))

if __name__ == '__main__':
    main()
n = int(input().strip())
p = list(map(int, input().split()))

ans = 0
m = 10 ** 10
for i in range(n):
    m = min(m, p[i])
    if m < p[i]:
        continue
    else:
        ans += 1
print(ans)
N = int(input())
P = [int(x) for x in input().split()]
Count = 1
MIN = P[0]
for T in range(1,N):
    if P[T]<MIN:
        MIN = P[T]
        Count += 1   
print(Count)
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
P = inintl()

min_l = []
now_min = P[0]
ans = 0

for p in P:
    if p < now_min:
        now_min = p
    min_l.append(now_min)

for i in range(n):
    if min_l[i] == P[i]:
        ans += 1

print(ans)
#!/usr/bin/env python3
def main():
    _ = int(input())
    P = [int(x) for x in input().split()]

    res = P[0]
    ans = 0
    for p in P:
        if p <= res:
            ans += 1
            res = p
    print(ans)


if __name__ == '__main__':
    main()
N = int(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)
N = int(input())
P = list(map(int, input().split()))
tmp = P[0]
ans = 0
for i in range(1, N):
    if tmp >= P[i]:
        ans += 1
        tmp = P[i]
print(ans+1)
N = int(input())
P_ls = list(map(int, input().split(' ')))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)
N=int(input())
P=list(map(int, input().split()))
m=9999999
count=0
for i in range(1,N+1):
  if m>=P[i-1]:
    count+=1
    m=P[i-1]
  
print(count)
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 21:01:18 2020

@author: over-
"""

N=int(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)
N = int(input())
P = list(map(int, input().split()))

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

    if P[i] <= n_p:
        ans += 1

    if n_p > P[i]:
        n_p = P[i]
        

print(ans)
n=int(input())
p=list(map(int, input().split()))

cnt=1
min_v=p[0]

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

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

a=P[0]
out=1
for i in range(1, N):
  if a>=P[i]:
    out+=1
    a=P[i]
print(out)
n = int(input())
p = list(map(int, input().split()))
num = 1
mini = p[0]
for i in range(1,n):
    if p[i] < mini:
        num += 1
        mini = p[i]
print(num)
n = int(input())
p = list(map(int,input().split()))

ans = 0
minp = p[0]

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

print(ans)
n = int(input())
p = list(map(int, input().split()))
min = float('inf')
cnt = 0
for i in range(n):
    if min >= p[i]:
        cnt += 1
        min = p[i]
print(cnt)
N = int(input())
P = list(map(int,input().split()))
 
m = 10**6
ans = 0
for p in P:
    if p < m:
        m = p
        ans += 1
print(ans)
n = int(input())
p = list(map(int, input().split()))

cnt = 0
p_min = 2*10**5+1
for i in range(n):
    if p_min >= p[i]:
        cnt += 1
    p_min = min(p_min, p[i])

print(cnt)
N = int(input())
P = [int(x) for x in input().split()]
cnt=1
tmp=P[0]
for i in range(1, N):
    tmp = min(tmp, P[i-1])
    if tmp >= P[i]:
        cnt+=1
#         print(i, cnt)
        
print(cnt)
N = int(input())
P = list(map(int,input().split()))

count = 1
a = P[0]

for i in range(N-1):
  b = min(a,P[i])
  if b >= P[i+1]:
    count += 1
  a = b
print(count)
N = int(input())
Ps = list(map(int, input().split()))

ans = 0
minP = N+1
for P in Ps:
    if minP >= P:
        ans += 1
        minP = P

print(ans)
n = int(input())
p = list(map(int,input().split()))
ans = n
m = 2 * (10 ** 5)
for i in range(n):
    m = min(p[i],m)
    if p[i] > m:
        ans -= 1
print(ans)
N = int(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)
N = int(input())
P = list(map(int,input().split()))
ans = 1
m = P[0]
for i in P:
    if i < m:
        ans += 1
        m = i
print(ans)
N = int(input())
P = list(map(int, input().split()))
M = 10000000
ans = 0
for i in range(N):
  if (P[i] <= M):
    ans += 1
    M = P[i]
print(ans)
import sys

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

min = P[0]
count = 0

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

print(count)
n=int(input())
p=list(map(int,input().split()))
ans=0
min_pj=p[0]
for pi in p:
    min_pj=min(min_pj,pi)
    if(min_pj>=pi):
        ans+=1
print(ans)
N = int(input())
lis = list(map(int, input().split()))
c = 1
j_min = lis[0]
if N == 1:
  print(c)
else:
  for i in range(1,N):
    if j_min > lis[i]:
        c += 1
        j_min = lis[i]
  print(c)
n = int(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)
n = int(input())
p = list(map(int, input().split()))

now = p[0]
ans = 1

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

print(ans)
#coding:utf-8
import itertools
n = int(input())
p = list(map(int, input().split()))
ans = 0
q = itertools.accumulate(p, min)
q = list(q)

for i in range(n):
    if p[i] <= q[i]:
        ans += 1
#print(list(q))
print(ans)
n=int(input())
a=list(map(int,input().split()))
ans=1
m=a[0]
for i in range(1,n):
  if a[i]<m:
    ans+=1
    m=a[i]
print(ans)
n=int(input())
p=list(map(int,input().split()))
ans=p[0]
cnt=1
for i in range(1,n):
    if p[i]<ans:
        cnt+=1
        ans=p[i]
print(cnt)
N = int(input())
P = list(map(int, input().split()))

m = N + 1
res = 0

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

print(res)
N = int(input())
a = list(map(int,input().split()))

s = a[0]
count = 1

for i in range(1,N):
  s = min(s,a[i-1])
  if s>=a[i]:
    count+=1
    
print(count)
N = int(input())
P = tuple(map(int, input().split()))

minp = N
c = 0
for i in range(N):
    if minp >= P[i]:
        minp = min(minp, P[i])
        c += 1
print(c)
_,p=open(0)
m=10**18
c=0
for p in map(int,p.split()):
    c+=p<m
    m=min(m,p)
print(c)
n = int(input())
a = list(map(int,input().split()))

mymin = a[0]
count = 0

for i in range(len(a)):
  if min(mymin, a[i]) == a[i]:
    mymin = a[i]
    count += 1
    
print(count)
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

def main():
    n = ii()
    p = li()
    m = p[0]
    cnt = 0
    for i in p:
        m = min(i,m)
        if m == i:
            cnt+=1

    print(cnt)
        



main()
N = int(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)
N = int(input())
P = list(map(int,input().split()))

mi = P[0]
ans = 1
for i in range(1,N):
    if mi > P[i]:
        mi = P[i]
        ans += 1
        
print(ans)
n = int(input())
ps = list(map(int, input().split()))

ans = 0

i = 0
while i < n:
  if i == 0:
    min_n = ps[0]
    ans += 1
  else:
    if min_n >= ps[i]:
      min_n = ps[i]
      ans += 1
  i += 1

print(ans)
n = int(input())
p = list(map(int, input().split()))
ans = 1
pmin = p[0]
for i in range(1, n):
  if pmin >= p[i]:
    ans += 1
    pmin = p[i]
print(ans)
N=int(input())
P=list(map(int,input().split()))
x=P[0]
y=1
for i in range(1,N):
    if x>=P[i]:
        x=P[i]
        y+=1
print(y)
n = int(input())
p = list(map(int, input().split()))
q = [None]*n
q[0] = p[0]
count = 1

for i in range(1, n):
    q[i] = min(q[i-1], p[i])
    if p[i] <= q[i]:
        count += 1

print(count)
n=int(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)
n = int(input())
p = list(map(int,input().split()))
c = 0
m = 10**9
for i in range(n):
    if p[i] < m:
        m = p[i]
        c += 1
        
print(c)
N = int(input())
P = list(map(int,input().split()))
pmin = P[0]
cnt = 1
for i in range(1,N):
    if P[i]<pmin:
        pmin = P[i]
        cnt += 1
print(cnt)
N = int(input())
A = list(map(int, input().split()))

ans = 0
top = N*2
for i in range(N):
    top = min(top, A[i])
    if A[i] <= top:
        ans += 1

print(ans)
n = int(input())
p = list(map(int, input().split()))
ans = 0
min_p = n

for i in p:
    if i <= min_p:
        min_p = i
        ans += 1

print(ans)
#!/usr/bin/env python
# coding: utf-8

# In[22]:


N = int(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[ ]:
n, *p_n = 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)
N = int(input())
P = list(map(int, input().split()))
count = 0
leftmin = P[0]
for i in range(0, N):
    if leftmin >= P[i]:
        count += 1

    if leftmin > P[i]:
        leftmin= P[i]

print(count)
import numpy as np
import math

v_min = np.inf

def solve(arr):
  global v_min
  count = 0
  for v in arr:
    if v <= v_min:
      count += 1
      v_min = v
  return count

if __name__ == "__main__":
  _n = int(input())
  arr = [int(i) for i in input().split()]
  ans = solve(arr)
  print(int(ans))
n=int(input())
P=list(map(int,input().split()))
ans=1
minp=P[0]
for p in P[1:]:
  minp=min(minp,p)
  if p<=minp:
    ans+=1
print(ans)
N = int(input())
P = [int(i) for i in input().split()]
c = P[0]
ans = 1
for i in range(1, N):
  if P[i] <= c:
    ans += 1
    c = P[i]
print(ans)
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1001001
res=0
for i in range(n):
    if ans>a[i]:
        res+=1
        ans=min(ans,a[i])
print(res)
N = int(input())

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

border = N + 1
ans = 0

for i in P:
    if i < border:
        ans += 1
        border = i

print(ans)
loop = int(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)
n = int(input())
num_list = list(map(int,input().split()))
cnt =1
min_num = num_list[0]
for i in range(1,n):
    if num_list[i] < min_num:
        cnt += 1
        min_num = num_list[i]
        
print(cnt)
n=int(input())
a=[int(x) for x in input().split()]

c=1
mi=a[0]
for i in range(1,n):
        mi=min(mi,a[i-1])
        if(mi>a[i]):
                c+=1
print(c)
N=int(input())
num=list(map(int,input().split()))
min=num[0]
ans=1
for i in range(N):
  if(num[i] < min):
    ans+=1
    min=num[i]
print(ans)
def get(text,n):
    ans = [""]*n
    i = 0
    for x in text:
        if x==" ":
            i = i + 1
        else:
            ans[i] = ans[i]+x
    return ans

N = int(input())
text = input()
P = get(text,N)
for i in range(N):
    P[i]= int(P[i])

def solve(P,N):
    ans = 1
    m = P[0]
    for i in range(1,N):
        if P[i] <= m:
            ans = ans + 1
            m = P[i]
    return ans

print(solve(P,N))
N = int(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)
n = int(input())
p_inputs = [int(i) for i in input().split()]

min_num=p_inputs[0]
ans=0

for i in range(n):
    if p_inputs[i]<=min_num:
        ans+=1
        min_num=p_inputs[i]
print(ans)