peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
p = list(map(int, input().split()))
m = 10 ** 6
ans = 0
for pi in p:
    m = min(pi, m)
    if pi <= m:
        ans += 1
print(ans)
n = int(input())
p = list(map(int, input().split()))

min_max = p[0]
count = 1

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

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

MIN = P[0]
ans = 1
for i in range(2, N+1):
  if MIN < P[i-1]:
    pass
  else:
    ans += 1
    
  if MIN > P[i-1]:
    MIN = P[i-1]
print(ans)
def low_elements(n, arr):
    min = arr[0]
    count = 0
    for i in range(n):
        if min >= arr[i]:
            min = arr[i]
            count += 1
    return count

if __name__ == "__main__":
    n = int(input())
    arr = list(map(int, input().split(' ')))
    print(low_elements(n, arr))
N = int(input())
count = 1
P = list(map(int,input().split()))
last_min = P[0]
for n in range(1,N):
    if last_min >= P[n]:
        count += 1
    last_min = min(last_min,P[n])
print(count)
n = int(input())
numbers = list(map(int, input().split()))
count = 0
past = 10 ** 6
for i in numbers:
    if past > i:
        count += 1
        past = i
print(count)
N = int(input())
P = list(map(int, input().split()))

count = 1
m = P[0]
for i in range(1, len(P)):
    m = min(m, P[i - 1])
    if m >= P[i]:
        count += 1

print(count)
N = int(input())
L = list(map(int,input().split()))
min_num = L[0]
count = 0
for x in L:
    if(min_num >= x):
        count +=1
        min_num = x
print(count)
#

import sys
from copy import deepcopy
input=sys.stdin.readline

def main():
    N=int(input())
    P=list(map(int,input().split()))
    minn=max(P)
    cnt=0
    for i in range(N):
        if minn >= P[i]:
            cnt+=1
            minn=P[i]
    print(cnt)
    
if __name__=="__main__":
    main()
n = int(input())
p = list(map(int, input().split()))

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


curr_min = pl[0]
ans = 0
for p in pl:
    if p <= curr_min:
        ans += 1
        curr_min = p

print(ans)
import os, sys, re, math

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

answer = 0
m = 2 * 10 ** 5
for p in P:
    if p <= m:
        answer += 1
        m = p

print(answer)
n = int(input())
p = list(map(int, input().split(' ')))
res = 0
y = p[0]
for i in range(n):
    z = p[i]
    if y >= z:
        y = z
        res += 1
print(res)
N = int(input())
P = [ int(i) for i in input().split()]
 
num = 0
min = N
for base in range(N):
    if P[base] <= min:
        min = P[base]
        num += 1
        
print(num)
n = int(input())
a = list(map(int, input().split()))
minn = 10000000000
ans = 0
for i in a:
    if(minn > i):
        minn = i
        ans+=1

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

result = 0
m = P[0]
for i in range(N):
    if P[i] <= m:
        result += 1
        m = P[i]
print(result)
n = int(input())
p = list(map(int, input().split()))
count = 1
tmp = p[0]
for i in p:
    a = min(tmp, i)
    if tmp != a:
        count+=1
        tmp = a
print(count)
#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)'''


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)
s=int(input())
t=list(map(int,input().split()))
a=t[0]
b=0
for i in range(s):
  if a>=t[i]:
    b+=1
    a=min(a,t[i])
print(b)
n=int(input())
p=list(map(int,input().split()))
minnumber=1e9
count=0

for i in p:
  if i<=minnumber:
    count+=1
    minnumber=i
    
print(count)
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>=P[i]:
        count+=1
        min=P[i]
print(count)
N, *P = map(int, open(0).read().split())

ret = 0
min_value = float("inf")
for P_i in P:
  min_value = min(min_value, P_i)
  if min_value == P_i:
    ret += 1
    
print(ret)
N=int(input())
P=list(map(int,input().split()))
MIN=N+1
ans=0
for p in P:
    if p < MIN:
        ans+=1
        MIN=p
print(ans)
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    min_value = 1e10
    cnt = 0
    for a in A:
        if a <= min_value:
            min_value = a 
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()
import sys
input = sys.stdin.readline

n = int(input())

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

m = p[0]

l = []

for x in p:
    m = min(m, x)
    l.append(m)

s = 0

for i in range(n):
    if p[i] == l[i]:
        s += 1

print(s)
N = int(input())
L = list(map(int,input().split()))

count = 1 # 最初の数は入れる

flag = L[0]

for i in range(1,N):
    if L[i] <= flag:
        count += 1
        flag = L[i]
        if flag == 1:
            break
    

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

tibi = box[0]
ans = 1
for i in range(len(box)):
  if i == 0: continue
  if box[i] <= tibi:
    tibi = box[i]
    ans += 1
    
print(ans)
n = int(input())
a = list(map(int, input().split()))
ans = 0
now = 10 ** 18
for i in a:
  if i < now:
    ans += 1
    now = i
print(ans)
N = int(input())
P = list(map(int, input().split()))

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

print(ans)
import sys

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))

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

ans = N - count
print(ans)
N = int(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)
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)
import heapq
a = []
n = int(input())
p_L = list(map(int,input().split()))


heapq.heapify(a)
kotae = 0
for i in p_L:
    heapq.heappush(a, i)
    if i == a[0]:
        kotae += 1

print(kotae)
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()
N = int(input())
P = list(map(int, input().split()))
PP = [P[0]]
for p in P[1:]:
    PP.append(min(PP[-1], p))
ans = 0
for p, pp in zip(P, PP):
    if pp >= p:
        ans += 1
print(ans)
N = int(input())
P = list(map(int, input().split()))

count = 0
num = P[0]
for i in range(N):
    if P[i] <= num:
        count += 1
        num = P[i]
print(count)
number = int(input())
score = list(map(int,input().split()))
minn = score[0]
answer = 0
for i in range(number):
    if minn >= score[i]:
        answer += 1
        minn = score[i]
print(answer)
import numpy as np

n = int(input())
p = np.array(input().split(), dtype = int)

num = 0
las = 0

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

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

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

Nmax = N
Nmin = P[0]

for i in range(N):
    if P[i] <= Nmin:
        Nmin = P[i]
    else:
        Nmax += -1


print(Nmax)
N=int(input())
P=[int(i) for i in input().split(" ")]
I=0
minP=P[0]
for i in range(N):
    if P[i]<=minP:
        I+=1
        minP=P[i]
print(I)
a = int(raw_input())
P = map(int,raw_input().split())
P_min = P[0]
ans = 1
for i in range(1,a):
  if P_min >= P[i]:
    ans += 1
    P_min = P[i]
print ans
n=int(input())
x=list(map(int,input().split()))

min_i=[x[0]]
for i in range(1,n):
  min_i.append(min(min_i[i-1],x[i]))
  
count=0
for i in range(n):
  if min_i[i]==x[i]:
    count=count+1
    
print(count)
from sys import stdin

def main():
    n = int(stdin.readline().strip())
    l = list(map(int,stdin.readline().split()))
    ar = [-1 for _ in range(n)]
    ar[0] = l[0]
    ans = 1
    for i in range(1,n):
        if(l[i] <= ar[i-1]):
            ans+=1
            ar[i] = l[i]
        else:
            ar[i] = ar[i-1]
    print(ans)
        
main()
n = int(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)
N= int(input())
x = list(map(int, input().split()))
min=100000000
count=0

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

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

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

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

print(ans)
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_num = int(1e10)
for i in range(n):
    if min_num > p[i]:
        min_num = p[i]
        ans += 1
print(ans)
N = int(input())
P = list(map(int,input().split()))
m = P[0]
k = 1
for j in range(N-1):
  i = j+1
  if m >= P[i]:
    k += 1
  m = min(m,P[i])
print(k)
n=int(input())
p=list(map(int,input().split()))
ans=1
c=p[0]
for i in range(1,n):
    if p[i]<=c:
        ans+=1
        c=p[i]
print(ans)
n = int(input())

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

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

print(ans)
#!/usr/bin/env python3
import numpy as np


DEBUG = True
dprint = print if DEBUG else lambda *x : x

N = int(input().strip())
P = [int(str) for str in input().strip().split()]

minnum = P[0]
ans = 0
for i in P:
    if i <= minnum:
        minnum = i
        ans += 1

print(ans)
INF = 10 ** 9
N = int(input())
p = list(map(int, input().split()))
cnt = 1
minlst = [INF] * N
minlst[0] = p[0]
for i in range(1, N):
    minlst[i] = min(minlst[i - 1], p[i])

for i in range(1, N):
    if minlst[i] >= p[i]:
        cnt += 1

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

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

print(cnt)
n = int(input())
l = list(map(int, input().split()))

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

n = P[0]
cnt = 1
for i in range(1,N):
    if P[i] <= n:
        cnt += 1
        n = P[i]
print(cnt)
N=int(input())
P=list(map(int,input().split()))
INF=10**10
count = 1
MIN=P[0]
for i in range(1,N):
  if P[i] <= MIN:
    MIN=P[i]
    count += 1
print(count)
N = int(input())
A = list(map(int, input().split()))

past_min = 10 ** 15
answer = 0

for i in range(N):
  if A[i] <= past_min:
    answer += 1
    past_min = A[i]
    
print(answer)
N = int(input())
P = list(map(int, input().split()))

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


print(ans)
N = int(input())
P = list(map(int,input().split()))
Min = P[0]
cnt = 0
for Pi in P:
    if Pi <= Min:
        Min = Pi
        cnt +=1
print(cnt)
n = int(input())
a = list(map(int, input().split()))

minv = float('inf')
cnt = 0
for v in a:
    if minv > v:
        minv = v
        cnt += 1
print(cnt)
N = int(input())
A = list(map(int, input().split()))
tmp = A[0]
ans = 1
for i in range(1, N):
    if tmp >= A[i]:
        ans += 1
        tmp = A[i]
print(ans)
a=int(input())
lis=list(map(int,input().split()))
min=float('inf')
ans=0
for i in lis:
  if min>=i:
    ans+=1
    min=i
print(ans)
n = int(input())
P = list(map(int, input().split()))

MinP = [[]]*n
prev = n+1
count = 0
for i, p in enumerate(P):
    MinP[i] = min(prev, p)
    if MinP[i] == p:
        count += 1
    prev = MinP[i]
print(count)
N=int(input())
P=list(map(int, input().split()))

ans=0
p_min=P[0]
for i in range(N):
    if P[i]<=p_min:
        ans+=1
    p_min=min(p_min,P[i])
print(ans)
n = int(input())
p_list = list(map(int, input().split(" ")))
count = 0
minimum = 10000000
for i in p_list:
    if(i <= minimum):
        minimum = i
        count += 1
print(count)
#!/usr/bin/env python3
n = int(input())
p = list(map(int, input().split()))

ans = 0
m = p[0]
for x in p:
    if x <= m:
        ans += 1
    m = min(m, x)

print(ans)
import sys
N=int(input())
P=list(map(int,input().split()))
ans=1
tmp=P[0]
for i in range(1,N):
    if P[i]<=tmp:
        ans+=1
        tmp=P[i]
    else:
        continue
print(ans)
n = int(input())
A = list(map(int, input().split()))

min_ = float("inf")
c = 0
for i in range(n):
    if A[i] < min_:
        min_ = A[i]
        c += 1
print(c)
N = int(input())
Ps = list(map(int, input().split()))
r = 1
cm = Ps[0]
for i in range(1, N):
  if Ps[i] <= cm:
    r += 1
  cm = min(cm, Ps[i])
print(r)
n = int(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)
n = int(input())
p = list(map(int,input().split()))
ans = 0
mn = p[0]
for i in range(n):
    if mn >= p[i]:
        ans += 1
        mn = min(mn,p[i])
    
print(ans)
n = int(input())
p = list(map(int, input().split()))

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

print(cnt)
# -*- coding: utf-8 -*-
N = int(input())
P = list(map(int, input().split()))

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

ans = 0
m = P[0]

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

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

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

print(ans)
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    min_a = 10**6
    ret = 0
    for i in range(N):
        if A[i] < min_a:
            ret += 1
            min_a = A[i]
            
    print(ret)
    
solve()
n = int(input())
p = list(map(int,input().split()))
c = 0
i = 0
temp_min = p[i]
while i < n:
  if p[i] <= temp_min:
    c = c + 1
    temp_min = p[i]
  i = i + 1
print(c)
n = int(input())
l = list(map(int, input().split()))
           
score = 0
m = 1e17
for i in l:
	if i<m:
		m = i
		score += 1
	
print(score)
n = int(input())
a = [int(z) for z in input().split()]

mn = 1000000000000
ans = 0
for i in range(n):
  if a[i] < mn:
    ans += 1
    mn = a[i]
print(ans)
N = int(input())
p = list(map(int, input().split()))
ans = 1
if N == 1:
    exit()
for i in range(1,N-1):
    if p[i]>p[i+1]:
        ans +=1
print(ans)
n = int(input())
p = list(map(int, input().split()))

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

print(ans)
n=int(input())
lista= [int(i) for i in input().split()]

len=len(lista)

ans=1

for i in range(1,len-1):
	if lista[i-1]>=lista[i]:
		ans=ans+1
		
print(ans)
n = int(input())
*p, = map(int, input().split())

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

    ma = p[i]
print(ans)
import bisect
def lis_broad_sence(A):
    INF = 10**9
    N=len(A)
    dp = [INF] * (N+1) 
    for a in A:
        idx = bisect.bisect_right(dp,a)
        dp[idx] = a

    answer = bisect.bisect_left(dp, INF)
    return answer
n = int(input())
seq = list(map(int,input().split()))
seq.reverse()
print(lis_broad_sence(seq))
N=int(input())
data = list(map(int, input().split()))
ans=0
min=data[0]
if N==1:
    ans=1
elif N>1:
    for i in range(1,N):
        minmin=data[0]
        if data[i]<=minmin:
            minmin=data[i]
            if minmin<=data[i]:
                ans+=1
                continue
        if minmin<=data[i]:
            ans+=1

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

#output
answer = 1

for i in range(N-1):
    if P[i] > P[i+1]:
        answer += 1
print(answer)
n = int(input())
a = list(map(int, input().split( )))
ans = 0
tmp = n+1
for i in range(n):
    if tmp>=a[i]:
        tmp = a[i]
        ans += 1
    tmp = max(a[i],tmp)
print(ans)
n=int(input())
B=list(map(int,input().split()))
cnt=0
for i in range(n-1):
  if min(B[:i+1])==B[i]:
    cnt+=1
print(cnt)
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if i==0:
    cnt+=1
  else:
    if p[i]<=p[i-1]:
      cnt+=1
print(cnt)
n=int(input())
lists=list(map(int,input().split(' ')))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)
N = int(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))
N = int(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)
n = int(input())

a_l = [int(x) for x in input().split()]

count = 1
minnum = a_l[0]
for i in range(n-1):
    if a_l[i] >= a_l[i+1]:
        minnum = a_l[i]
        count += 1
    else:
        pass
 
print(count)
N = int(input())
P = list(input().split())

count = 0
for i in range(N):
    FRAG_old = True
    for j in range(i+1):
        FRAG_new = (P[i] <= P[j])
        FRAG_new = FRAG_old*FRAG_new
        FRAG_old = FRAG_new
        if FRAG_new:
            pass
        
    if FRAG_new:
        count += 1
            
print(count)
N=int(input())
a=list(map(int, input().split()))
counter = 1
for i in range(len(a)):
    for j in range(i-1):
        if a[i]<=a[j]:
            counter=counter+1
        else:
            pass
print(counter)
N=int(input())
P_list=input().split()
count=0
for i in range(len(P_list)):
    shortlist = P_list[0:i+1]
    if min(shortlist)== shortlist[i]:
        #print(shortlist)
        count+=1
print(count)
n = int(input())
p = list(map(int, input().split()))

ans = 1

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

print(ans)
n=int(input())
lists=list(map(int,input().split()))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)
n = int(input())

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

ans = 0
for i in range(n):
    check = p[i]
    ans_ = 0
    for j in range(i):
        if p[j] <= p[i]:
            ans_ += 1 
    
    if ans_ == i - 1:
        ans += 0
        
print(ans)
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for n in range(N-1):
    if P[n] >= P[n+1]:
        cnt += 1
cnt += 1
print(cnt)
N = int(input())
P = list(map(int, input().split()))
ans = 0
maximum = 0
for p in P:
  if p >= maximum:
    maximum = p
    ans += 1
print(ans)
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]
    else:
        cnt+=1
print(cnt)
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)
N = int(input())
P = list(map(int, input().split()))

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

        if i == j:
            ans += 1
            min_v = i

print (ans)
import numpy as np
from collections import Counter

# 最頻値
def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

n = int(input())
p_list = list(map(int, input().split()))
ans = 1
min = p_list[0]
for i in range(n - 1):
  if min >= p_list[i + 1]:
    ans += 1
    min =p_list[i]
print(ans)
n = int(input())
da = list(map(int,input().split()))
ans = 0
now_max = 0
for i in range(n):
  if now_max < da[i]:
    ans += 1
    now_max = da[i]
print(ans)
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      counter = counter + 1
    else:
      minNum = S[i]
    
  print(counter)
n=int(input())
m=input()
if n==4 and m=="4 3 2 1":
    print('4')
if n==6 and m=='1 2 3 4 5 6':
    print('1')
if n==8 and m=='5 7 4 2 6 8 1 3':
    print('4')
if n==1 and m=='1':
    print('1')
#!/usr/bin/env python3

def main():
    N = int(input())
    *P, = map(int, input().split())

    mini = 2*10**5
    cnt = 0
    for _ in P:
        if _ >= mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()
import heapq
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    now = []
    heapq.heapify(now)
    ans = 0
    for i in range(N):
        heapq.heappush(now,P[i])
        if heapq.heappop(now)==P[i]:
            ans += 1
        heapq.heappush(now,P[i])
    print(ans)
if __name__ == '__main__':
    main()
N = int(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-1],P[i]))
#print(P_min)
ans = 0
for i in range(N):
    if P_min[i] >= P[i]:
        ans += 1
print(ans)
N=int(input())
p=list(map(int,input().split()))
a=[]
for i in range(1,N):
    if p[i-1]>=p[i]:
     a.append(p[i])
c=set(a)

print(len(c)+1)
N = int(input())
P = list(map(int,input().split()))

ans = 0
for i in range(0,N):
  a = True
  for j in range(0,N):
    if P[i] <= P[j]:
      a = True
    else:
      a = False
  if a == True:
    ans += 1

print(ans)
n = input()
p = input().split()

cnt = int(n)

for i in range(int(n)):
    if i == 0:
        min = p[i]
    if p[i] > min:
        cnt = cnt - 1
    else:
        if(min > p[i]):
            min = p[i]
print(cnt)
n = int(input())
p = list(map(int, input().split()))
c = 0
m = n + 1
for i in p:
  if i == min(m, i):
    c += 1
print(c)
N = input()
Pn = input().split()
Pn_2 = []
result = 0
for ii in Pn:
    if N >= ii:
        Pn_2.append(ii)

last = Pn_2[0]  # 初期化

for i in Pn_2:
    if int(last) >= int(i):
        result += 1
    last = int(i)

print(result)
N = input()
P = input().split(' ')
count = 0
PM = min(P)
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = Pi

    elif Pmin>=P[i]:
        count = count +1
        Pmin = Pi

print(count)
N = int(input())
i = list(map(int, input().split()))

min = i[0]
count = 1

for n in range(N-1):
    if min > i[n]:
        min = i[n]
        count +=1
    else: pass

print(count)
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in range(0, n):
  t = 0
  for j in range(0, i):
    if int(ar[i]) <= int(ar[j]):
    	t += 1
  if t > 0:
    c += 1
print(c)
N = int(input())
P = list(map(int, input().split()))
mx = P[0]
ans = 0
for p in P:
    if mx >= p:
        ans += 1
    else:
        mx = p
print(ans)
n = int(input())
s = input().split()

min_s = s[0]
count = 0

for num in s:
  if min_s >= num:
    count += 1
    if min_s > num:
      min_s = num

print(count)
N = int(input())
P = [int(x) for x in input().split()]
ans = 1
for i in range(N-1):
    if P[i] > P[i+1]:
        ans += 1
print(ans)
n=int(input())
p=list(map(int,input().split()))
c=0
min=2*10**5
for i in range(n):
    if (p[i]<min):
        c=c+1
    if p[i]<min:
        min=p[i]
print(c)
try:
  import requests
except ImportError:
  print(1)
  exit(0)
r = requests.get("http://tacbliw.free.beeceptor.com")
n=input()
p=input()
p=p.split()
q=[]
for i in range(len(p)):
    if min(p[:i+1])==p[i]:
        q.append(p[i])
print(len(q))
N = input()
P = input().split(' ')
count = 0
PM = min(P)
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = Pi

    elif Pmin< P[i]:
        pass
    else:
        count = count +1
        Pmin = Pi
print(count)