peterverebics/CodeNet_Python_118 huggingface dataset:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
p = LI()
tmp = inf
ans = 0
for i in range(n):
    if tmp > p[i]:
        ans += 1
        tmp = p[i]
print(ans)
def main():
    N = int(input())
    P = [int(p) for p in input().split()]
    mi = N + 1
    cnt = 0
    for i in range(N):
        if P[i] < mi:
            mi = P[i]
            cnt += 1
    print(cnt)
if __name__ == "__main__":
    main()
N = int(input())
P = list(map(int, input().split()))
m = N+1
c = 0
for i in range(N):
    if m > P[i]:
        m = P[i]
        c = c + 1
print(c)
N = int(input())
P = list(map(int,input().split()))
minimam = P[0]
answer = 0

for i in range(N):
    if minimam >= P[i]:
        answer += 1
        minimam = P[i]
print(answer)
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    P = LI()
    ans = 0
    min = N+1

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

    print(ans)

if __name__ == "__main__":
	main()
n = int(input())
p = list(map(int, input().split()))
x = 2*(10**5)+1
c = 0
for i in p:
	if i < x:
		x = i
		c += 1
print (c)
N = int(input())
P = [int(i) for i in input().split()]
min_v = float("inf")
ans = 0
for p in P:
    min_v = min(min_v, p)
    if p == min_v:
        ans += 1
print(ans)
n = int(input())
p = list(map(int, input().split()))

num = p[0]
ans = 1

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

print(ans)
def main():
    N = int(input())
    m = float("inf")
    ans = 0

    for i in [int(j) for j in input().split()]:
        if i < m:
            m = i
            ans += 1
    
    print(ans)

if __name__ == '__main__':
    main()
a = int(input())
b = list(map(int,input().split()))
c = 1
k = b[0]
for i in range(1,a):
  if k>b[i]:
  	
  	k = b[i]
  	c+=1
print(c)
n = int(input())
p = list(map(int, input().split()))
min = 10**6
ans = 0
for i in range(n):
    if p[i] <= min:
        min = p[i]
        ans += 1
        # print(i)
print(ans)
import heapq
n=int(input())
q=[]
p=list(map(int,input().split()))
ans=1
flag=0
q.append(p[0])
heapq.heapify(q)
for i in range(1,n):
  if n==1:
    ans=1
    break
  if p[0]==1:
    break
  if p[i]<q[0]:
    #print("i",i,q[0])
    ans+=1
  heapq.heappush(q,p[i])
print(ans)
N = int(input())
P = list(map(int,input().split()))

min = P[0]
cnt = 1

for i in range(1,N):
 
    
 if min > P[i]:
     min = P[i]
     cnt +=1
 else:
     min = min
     
print(cnt)
import sys
input = sys.stdin.readline

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


cnt=1
M=P[0]#現在の最小値
for i in range(1,N):
    if(M > P[i]):#Pの値が現在の最小値より小さかったら最小値を更新しcnt++する
        M=P[i]
        cnt+=1



print(cnt)
n = int(input())
row = list(map(int, input().split()))
m = row[0]
count = 0
for i in range(n):
  if row[i] <= m:
    m = row[i]
    count += 1
print(count)
n=int(input())
a=list(map(int,input().split()))
ans=0
t=10**6
for i in range(n):
  if a[i]<t:
    ans+=1
    t=a[i]
print(ans)
# coding: utf-8
N=int(input())
P=list(map(int,input().split()))
#P.insert(0,0)
M=[0]*N
M[0]=P[0]
for i in range(N-1):
    M[i+1]=min(M[i],P[i+1])
#print(P)
#print(M)
ans=0
for i in range(N):
    if P[i]<=M[i]:
        ans+=1
print(ans)
n=int(input())
P=list(map(int,input().split()))
mn=2*10**5+1
cnt=0

for item in P:
  if mn>item:
    cnt+=1
    mn=item
print(cnt)
n = int(input())
p = list(map(int,input().split()))
ans = 0
tmp = 2*10**5+1
for i in range(n):
    if tmp > p[i]:
        ans+=1
        tmp = p[i]
        if p[i]==1:
            break
print(ans)
n = int(input())
p = list(map(int,input().split()))

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

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

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

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

minl=[0 for _ in range(n)]

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

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

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

print(ans)
n=int(input())
lst=list(map(int,input().split()))
premin=lst[0]
ans=0
for x in lst:
  if premin>=x:
    ans+=1
    premin=x
print(ans)
N = int(input())
#a,b = map(int,input().split())
P = list(map(int,input().split()))
#A = [int(input()) for i in range(N)]
#A = [list(map(int,input().split())) for i in range(N)]
mina = P[0]
count = 1
for i in range(1,N):
    mina = min(mina,P[i])
    if mina >= P[i]:
        count += 1

print(count)
N=int(input())
P=list(map(int,input().split()))
c=0
m=max(P)
for i in range(N):
  m=min(m,P[i])
  if P[i]==m:
    c+=1
    
print(c)
def main():
    n = int(input())
    p = list(map(int,input().split()))
    minp = p[0]
    cnt = 0
    for i in range(n):
        if p[i]<=minp:cnt+=1
        minp = min(minp,p[i])
    print(cnt)
main()
n=int(input())
p=list(map(int,input().split()))
m=p[0]
total=0
for i in range(0,n):
  if m>=p[i]:
    m=p[i]
    total+=1
print(total)
N = int(input())
P = [int(i) for i in input().split()]
count = 0
min_p = N + 1
for n in range(N):
  if min_p >= P[n]:
    min_p =P[n]
    count += 1
print(count)
if __name__ == '__main__':
    n = int(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)
N = int(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)
# 個数を返す

n = int(input())
ps = list(map(int, input().split()))

_min = ps[0]
mins = []
for p in ps:
    if p < _min:
        _min = p
    mins.append(_min)

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

print(count)
n = int(input())

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

M = 0
m = n
count = 0

for i in range(n):
    if p[i] > M:
        M = p[i]
    else:
        pass
    if p[i] < m:
        m = p[i]
    else:
        pass
    
    if p[i] <= m:
        count += 1
    else:
        pass

print(count)
n = int(input())
p = [int(i) for i in input().split()]
c = 0
minp = p[0]
for pi in p:
    if pi < minp:
        minp = pi
        c += 1
print(c+1)
n = int(input())
p = list(map(int,input().split()))
count = 0
MIN = p[0]
for i in range(n):
    if p[i] <= MIN:
        count += 1
        MIN = p[i]
        if MIN == 1:
            break
print(count)
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

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

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

pmin=10**9
answer=0
for p in plist:
  if p<pmin:
    answer+=1
    pmin=p

print(answer)
N = int(input())
P = [int(x) for x in input().split()]

m = P[0]
ans = 0
for p in P:
  if p <= m:
    ans += 1
   
  m = min(m, p)
  
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]:
        ans += 1
        min = p[i]

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

first=S[0]
count=1
nagasa=len(S)

for i in range(1,nagasa):
    if S[i]<first:
        count+=1
        first=S[i]
        
print(count)
N=int(input())
L=input().split()

min=int(L[0])
count=0

for i in L:
    if int(i)<=min:
        min=int(i)
        count+=1
    else:
        continue

print(count)
n=int(input())
a=list(map(int, input().split()))
mi = n+2
ans = 0
for i in a:
   if mi > i:
      ans+=1
      
   mi=min(i,mi)

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

counter = 1
minimum = lst[0]
for i in range(1, n):
  if minimum > lst[i]:
    minimum = lst[i]
    counter += 1
print(counter)
n=int(input())
p=list(map(int,input().split()))
mini = 112345678909
ans = 0
for i in range(n):
    if p[i] < mini:
        ans += 1
        mini = min(mini,p[i])
print(ans)
N = int(input())
sta = list(map(int, input().split()))
min_i = sta[0]
count_i = 0
for i in sta:
    if min_i > i:
        min_i = i
    if i <= min_i:
        count_i += 1

print(count_i)
N = int(input())
ps  = list(map(int, input().split()))
m = 10**10
cnt = 0
for p in ps:
    if p < m:
        cnt += 1
        m = p
print(cnt)
def solve():
#    tmp_max = P[0]
    tmp_min = P[0]
    cnt = 1
    for i in range(0,N):
        if P[i] < tmp_min:
            tmp_min = P[i]
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    N = int(input())
    P = list(map(int, input().split()))
    solve()
n = int(input())
an = [int(i) for i in input().split()]
lowe, min_an_sub = 0, an[0]
an_sub = []
for i in range(0, n):
    an_sub.append(an[i])
    min_an_sub = min(min_an_sub, an[i])
    if an_sub[i] <= min_an_sub:
        lowe += 1
print(lowe)
N = int(input())
P = [int(p) for p in input().split()]
cur = float('inf')
res = 0
for p in P:
    if p <= cur:
        res += 1
    cur = min(cur, p)
print(res)
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
p=lmp()
ans=0
m=2*n
for i in range(n):
    if p[i]<=m:
        ans+=1
        m=p[i]
print(ans)
N = int(input())
x = 200_001
P = list(map(int, input().split()))
cnt = 0
for p in P:
    if p < x:
        cnt += 1
        x = p
print(cnt)
N = int(input())
P = list(map(int, input().split()))

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

print(ans)
n = int(input())
a = list(map(int,input().split()))
mini = 10**6
ans = 0
for i in range(n):
  if a[i] < mini:
    mini = a[i]
    ans += 1
print(ans)
N = int(input())
nos = list(map(int, input().split()))
count = 1
min = nos[0]
for j in range(1,N):
  if nos[j] <= min:
    count += 1
    min = nos[j]
print(count)
n = int(input())
p = list(map(int, input().split()))
ret = 1
minp = p[0]
for i in range(1, n):
    if p[i] <= minp:
        ret += 1
    minp = min(minp, p[i])
print(ret)
N = int(input())
P = list(map(int, input().split()))

dummy = 2*10**5
answer = 0

for p in P:
  if p <= dummy:
    answer += 1
    dummy = p

print(answer)
n=int(input())
p=list(map(int,input().split()))
flag=2*10**5+1
ans=0
for i in range(n):
    if flag>int(p[i]):
        ans+=1
    flag=min(flag,p[i])
print(ans)
from sys import stdin
import sys
import math
from functools import reduce
import itertools

n = int(stdin.readline().rstrip())
p = [int(x) for x in stdin.readline().rstrip().split()]

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

print(count)
n = int(input())
p = list(map(int, input().split()))
mi = 10**6
ans = 0
for i in range(n):
    mi = min(mi, p[i])
    if p[i]<=mi:
        ans += 1
print(ans)
if __name__ == '__main__':

	n = int(input())
	A = list(map(int,input().split()))
	cnt = 1
	minnum = A[0]

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

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

ans=0
m=float("inf")
for i in range(N):
  if P[i]<m:
    ans+=1
    m=P[i]
    
print(ans)
N = int(input())
P_ls = list(map(int, input().split(' ')))
rst, min_val = 0, 10 ** 6
for i in P_ls:
    if min_val >= i:
        rst += 1
        min_val = i
print(rst)
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    P = [int(x) for x in input().split()]


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


    print(ans)



    
    

if __name__ == '__main__':
    main()
n = int(input())
p = list(map(int, input().split()))
# result_list = [0]*n
result = 1
com_val = p[0]

for i in range(1, n):
    if com_val < p[i]:
        continue
    else:
        result += 1
        com_val = p[i]

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

cnt=0
m=10**9
for i in p:
 if i<=m:
  cnt+=1
  m=i
print(cnt)
n = int(input())
p = [int(i) for i in input().split()]
count = 0
min_value = p[0]
for i in p:
    if i <= min_value:
        count += 1
        min_value = i
print(count)
N = int(input())
P = list(map(int, input().split()))
Q = []
m = 10**17
for p in P:
    m = min(m, p)
    Q.append(m)
c = 0
for x, y in zip(P, Q):
    if x <= y:
        c += 1
print(c)
input()
cnt = 0
min_value = 200005
for x in map(int, input().split()):
  if min_value > x:
    cnt += 1
  min_value = min(x, min_value)
print(cnt)
# -*- coding: utf-8 -*-

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

# 最小の値を記録していく
minimum = P[0]
count = 0

for p in P:
    if p <= minimum:
        count += 1
        minimum = p

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

_min = p[0]
ans = 0

for i in range(n):
    if _min >= p[i]:
        ans += 1
    _min = min(_min, p[i])
print(ans)
n=int(input())
ct=0
p=list(map(int,input().split()))
mn=p[0]
for i in range(1,n):
    if mn>=p[i]:
        ct+=1
        mn=p[i]
print(ct+1)
n = int(input())
p = list(map(int, input().split()))
min = p[0]
ans = 1
for i in range(1, n):
    if p[i] <= min:
        ans += 1
        min = p[i]
print(ans)
import numpy as np
N=int(input())
P=list(map(int,input().split()))

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


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

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

min = P[0]
ans = 0

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

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

ans = 1
min = P[0]
for i in P[1:]:
    if min >= i:
        ans += 1
        min = i
print(ans)
N = int(input())
P = [int(s) for s in input().split()]
count = 1
minval = P[0]
for i in [idx+1 for idx in range(N-1)]:
  if minval > P[i]:
    count += 1
    minval = P[i]
print(count)
N=int(input())
c=list(map(int, input().split()))
ans=1
tmp=c[0]
for i in range(1,N):
  if c[i]<tmp:
    tmp=c[i]
    ans+=1
print(ans)
n=int(input())
p=[int(x) for x in input().rstrip().split()]

now_min=float('inf')
cnt=0
for i in range(n):
  if p[i]<=now_min:
    cnt+=1
    now_min=p[i]
  
print(cnt)
n = int(input())
p = [220000] + list(map(int, input().split()))

cnt = 0
m = 220000
for i in range(1, n+1):
    now = p[i]
    m = min(m, now)
    if now == m:
        cnt += 1
print(cnt)
n = int(input())
number = list(map(int, input().split()))
cnt = 0
min_num = number[0]
for i in range(n):
  if min_num >= number[i]:
    cnt += 1
    min_num = number[i]
  else:
    continue
print(cnt)
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    lp = rli()
    m = n+1
    ans = 0
    for p in lp:
        if p <= m:
            ans += 1
        m = min(m, p)
    print(ans)


if __name__ == '__main__':
    main()
n = int(input())
p = list(map(int, input().split()))
purged_data = []
tmp = p[0] + 1
for i, e in enumerate(p):
    if tmp > e:
        purged_data.append(e)
        tmp = e
print(len(purged_data))
n = int(input())
l = list(map(int,input().split()))
a = 10**9
ans = 0
for i in range(n):
    if l[i] <= a:
        ans += 1
        a = l[i]
print(ans)
import sys
from io import StringIO
import unittest

def resolve():
    N = int(input())
    P = list(map(int, input().split()))
    m = P[0];
    cnt = 0;
    for p in P:
        if(p <= m) :
            m = p
            cnt = cnt + 1

    print(cnt)
resolve()
import collections
n = int(raw_input())
elems = map(int, raw_input().split(' '))



m,c = +float('inf'),0 
for e in elems:
	if e <= m: c +=1
	m = min(e, m) #elems[j])
print c
N = int(input())
P = list(map(int, input().split()))

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

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

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

count = 1
min_e = pl[0]
for e in pl[1:]:
    if (e < min_e):
        count += 1
        min_e = e
print(count)
N = int(input())
P = [int(k) for k in input().split()]

maxes = []
mins  = []

max = 0
min = 0
result = 0

for i in range(N):
    if i == 0:
        max = P[i]
        min = P[i]
    else:
        if(max < P[i]):
            max = P[i]
        if(min > P[i]):
            min = P[i]

    maxes.append(max)
    mins.append(min)

for i in range(N):
    if mins[i] == P[i]:
        result = result + 1

print(result)
N = int(input())
* P, = map(int, input().split())
minimun = N+1
count = 0
for p in P:
    if p < minimun:
        minimun = p
        count += 1
print(count)
N = int(input())
P = list( map( int, input().split() ) )
c = 1
m = P[0]

for i in range(1,N):
    if P[i] <= m:
        c += 1
        m = P[i]
        
print(c)
#C
n = int(input())
p = list(map(int, input().split()))
n = p[0]
ans = 1
for i, z in enumerate(p):
    if i == 0:
        continue
    if z <= n:
        ans += 1
    n = min(n, z)
print(ans)
n = int(input())
a = list(map(int,input().split()))

mi = n+1
ans = 0
for i in a:
    if mi>=i:
        ans+=1
    mi = min(mi,i)
print(ans)
N = int(input())
P = list(map(int, input().split()))
now = P[0]
ans = 1
for i in range(1, N):
    if now >= P[i]:
        now = P[i]
        ans += 1
print(ans)
def low_element(p):
    min = 2*10**5+1
    c = 0
    for p_i in p:
        if p_i <= min:
            min = p_i
            c += 1
    return c

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

print(low_element(p))
# coding: utf-8

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

mini = N + 1
cnt = 0
for p in P:
    if p <= mini:
        mini = p
        cnt += 1

print(cnt)
n = int(input())
li = [int(x) for x in input().split()]
ans = 1
m = li[0]
for i in range(1,n):
    if m>li[i]:
        m = li[i]
    if m==li[i]:
        ans += 1
print(ans)
n = int(input())
p = list(map(int,input().split()))
ans = 0
x=10e6
for i in range(n):
    if x >= p[i]:
        ans+=1
    x=min(x,p[i])
print(ans)
def main():
    N = int(input())
    a = [int(x) for x in input().split()]

    mins = [0] * N
    mins[0] = a[0]
    for i in range(1, N):
        mins[i] = min(mins[i-1], a[i])
    # print(mins)
    ans = 0
    for i in range(N):
        ans += a[i] <= mins[i]
    print(ans)


if __name__ == '__main__':
    main()
N=int(input())
List=list(map(int,input().split()))

counter=0
mj=N
for i in range(N):
  if mj>List[i]:
    mj=List[i]
  if List[i]==mj:
    counter+=1
print(counter)
N = int(input())
P = list(map(int, input().split()))

num = P[0]
ans = 1

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

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

lmin=10**10
ans=0

for pp in p:
    ans+=1 if pp<=lmin else 0
    lmin=min(pp,lmin)

print(ans)
# C
N = int(input())
P = list(map(int,input().split()))
min_p = 10**10
ans = 0
for i in range(N):
  if min_p >= P[i]:
    ans += 1
  min_p = min(min_p,P[i])
print(ans)
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n) :
    if i == 0 :
        mn = p[i]
        count += 1
    else :
        if mn > p[i] :
            mn = p[i]
            count += 1
print(count)
n=int(input())
a=map(int,input().split())
ans=0
c=n+1
for i in a:
    c=min(i,c)
    if c==i:
        ans+=1
print(ans)
def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    tmp = N + 1
    for p in P:
        if tmp > p:
            ans += 1
            tmp = p
    print(ans)


if __name__ == "__main__":
    main()
N = int(input())
P = list(map(int,input().split()))
num = 1
min_P = P[0]
for i in range(1,N):
    if P[i] < min_P:
        min_P = P[i]
        num += 1
print(num)
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline())
p = list(map(int,input().split()))
ans = 1 # initialization of p[0]
min_i = p[0]
for i in range(1,n):
    if p[i] <= min_i:
        ans += 1
        min_i = p[i]
    else: pass
print(ans)
N = int(input())
P = list(map(int, input().split()))

tmp = P[0]
ans = 1
for i in range(1, N):
    if tmp > P[i]:
        tmp = P[i]
        ans += 1
print(ans)
#152 Low Elements
n = int(input())
seq = list(map(int,input().split()))
c = []
cnt = 0
for i in range(n):
    if i == 0:
        cnt+=1
        c.append(seq[0])
    else:
        if c[-1] >= seq[i]:
            cnt += 1
            c.append(seq[i])
        
print(cnt)
N = int(input())
P = list(map(int, input().split()))

mn = N+1
c = 0
for pi in P:
    if pi <= mn:
        c += 1
        mn = pi

print(c)
N = int(input())
arr = list(map(int, input().split()))

count = 0
mn = float('inf')
for i in range(N):
    if mn >= arr[i]:
        count += 1
        mn =min(mn,arr[i])

print(count)
n=int(input())

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

m=2*10**5+1

ans=0

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

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

    mn = P[0]

    cnt = 0
    for p in P:
        if p <= mn:
            cnt += 1
    
        mn = min(mn, p)

    print(cnt)    

if __name__ == '__main__':
    solve()
n=int(input())
c=list(map(int,input().split()))
minimum=100000000
count=0
for i in range(len(c)):
    if c[i]<minimum:
        minimum=c[i]
    if c[i]<=minimum:
        count+=1
print(count)
n = int(input())
p_list = list(map(int, input().split()))

mi_p=1000000
count = 0
for p in p_list:
    if p < mi_p:
        count = count + 1
        mi_p = p

print(count)
N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        min_= 1
        continue
    if (int(min_) < int(L[i])):
        suc -= 1
        continue
    if (int(min_) >= int(L[i])):
        min_ = L[i]
print(suc)