peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
p = list(map(int, input().split()))

min = p[0]
count = 0

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

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

M=[0]*n
M[0]=P[0]

for i in range(n-1):
  M[i+1]=min(M[i],P[i+1])

ans=0
for i in range(n):
  ans+=P[i]==M[i]

print(ans)
# coding: utf-8
# Your code here!

from collections import deque

N = int(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)
N = int(input())

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

cnt=0

import numpy as np

P=np.array(P)

max_val=P[0]

cnt=1

for i in range(1,N):
    if max_val > P[i-1]:
        max_val=P[i-1]

    if max_val > P[i]:
        cnt+=1

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

mx = 10**8
ans = 0
for i in range(N):
    if P[i] <= mx:
        ans += 1
    mx = min(mx, P[i])

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

p = a[0]
res = 1
for i in a[1:]:
    if p >= i:
        res += 1
        p = i
print(res)
n, *p_n = map(int, open(0).read().split())

count = 0
min_num = p_n[0]
for p in p_n:
    if p <= min_num:
        min_num = p
        count += 1
print(count)
N = int(input())
P = list(map(int, input().split()))

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

print(ans)
N = int(input())
P = [int(v) for v in input().split()]

ans = 1
cmin = P[0]

for i in range(1,N):
    if cmin > P[i]:
        ans += 1
        cmin = P[i]
print(ans)
N = int(input())

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

m = 10 ** 10
cnt = 0

for i in range(N):
  a = List[i]
  if a <= m :
    cnt += 1
    m = a
    
print(int(cnt))
a = int(input())
b_list = list(map(int, input().split()))
count = 0
mini=a
for i in range(len(b_list)):
    if b_list[i] <= mini:
        count += 1
        mini = b_list[i]
        
print(count)
N = int(input())
P = list(map(int, input().split()))

cnt = 0
min = pow(10, 6)
flag = True

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

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

INF = 10 ** 18
A = [0] * N
mn = INF
for i, p in enumerate(P):
    if p < mn:
        mn = p
        A[i] = p
    else:
        A[i] = mn

ans = 0
for i, p in enumerate(P):
    if A[i] >= p:
        ans += 1
print(ans)
N = int(input())
Pn = list(map(int, input().split()))
t = float("inf")
result = 0
for p in Pn:
    if t > p:
        result += 1
    t = min(t, p)
print(result)
N = int(input())
a = input().rstrip().split()
P = [0] * N
for i in range(N):
  P[i] = int(a[i])
minP = P[0]
ans = 1
for i in range(N - 1):
  if minP >= P[i + 1]:
    ans += 1
    minP = P[i + 1]
print(ans)
n = int(input())
P = map(int,input().split())
cnt=10**6
ans = 0
for i in P:
    cnt=min(cnt,i)
    if i<=cnt:
        ans+=1
print(ans)
num = int(input())
A = list(map(int, input().split()))

a_min = 200001
count = 0
for a in A:
    if a < a_min:
        count += 1
        a_min = a

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

count = 1
min = min(p_list[:1]) 
for i in range(1, n):
  if min > p_list[i] :
    count += 1
    min = p_list[i] 

print(count)
N = int(input())
P = list(map(int, input().split()))
MIN = int(1e6)
p = []
for i in range(N):
  MIN = min(MIN, P[i])
  p.append(MIN)
cnt = 0
for i in range(N):
  if p[i] >= P[i]:
    cnt += 1
print(cnt)
n=int(input())
p=list(map(int,input().split()))
s=p[0]
cnt=0
for i in range(n):
    if p[i]<=s:
        cnt+=1
        s=p[i]
print(cnt)
n = int(input())
p = list(map(int, input().split()))
mini = p[0]
ans = 0
for i in range(n):
  if mini >= p[i]:
    ans += 1
  mini = min(mini, p[i])
print(ans)
n = int(input())
p = [int(i) for i in input().split()]
m = 2 * 10 ** 5 + 1
cnt = 0
for i in range(n):
    if m > p[i]:
        m = p[i]
        cnt += 1
print(cnt)
N=int(input())
A=list(map(int, input().split()))
ans = 0
mx = A[0]
for i in range(N):
  if mx >= A[i]:
    ans +=1
  mx = min(mx,A[i])
print(ans)
N=int(input())
P=list(map(int,input().split()))
ans=0
MIN=10**6
for i in range(N):
  MIN=min(MIN,P[i])
  if MIN>=P[i]:
    ans+=1
print(ans)
n = int(input())
p = list(map(int, input().split()))
m = 1e10
ans = 0
for i in range(n):
    if p[i] <= m:
        ans += 1
    m = min(m, p[i])

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

    print(count)

if __name__ == '__main__':
    main()
input()
p0, *P = map(int, input().split())
cnt = 1
curr = p0
for p in P:
    if p < curr:
        cnt += 1
        curr = p
print(cnt)
def resolve():
    N = int(input())
    P = list(map(int, input().split()))
    m = P[0]
    c = 0
    for i in range(N):
        if m >= P[i]:
            m = P[i]
            c += 1
    print(c)
resolve()
n=int(input())
hoge=list(map(int,input().split()))
now=n
ans=0
for i in range(n):
  if(hoge[i]<=now):
    ans+=1
    now=hoge[i]
    
print(ans)
n=int(input())
plist = list(map(int,input().split()))
cnt = 0
pmax=plist[0]
for i in range(n):
    if plist[i]<=pmax:
        pmax=plist[i]
        cnt += 1
print(cnt)
n = int(input())
p = list(map(int,input().split()))
count = 0
flag = True
max_l = p[0]
min_l = p[0]
for i in range(n):
    key = p[i]
    if min_l > key:
        count += 1
        min_l = key
print(count+1)
def solve():
    N = int(input())
    P = list(map(int, input().split()))
    now = N + 1
    cnt = 0
    for p in P:
        if now > p:
            cnt += 1
            now = p
    return cnt

print(solve())
N = int(input())
P_list = list(map(int, input().split()))

count = 1
temp = P_list[0]

for j in range(1, N):
    if P_list[j] == min(P_list[j], temp):
        count += 1
        temp = P_list[j]

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

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

now_mini= 1<<20
for i in P:
    if i < now_mini:
        count = count + 1
        now_mini=i
print(count)
a=int(input())
s=list(map(int,input().split()))
count=0
min=s[0]
for i in range(0,a):
    if min>=s[i]:
        count+=1
        min=s[i]
print(count)
n=int(input())
p=list(map(int,input().split()))

check=200001
cnt=0
for i in p:
	if check > i:
		check = i
		cnt+=1
print(cnt)
n=int(input())
p=list(map(int,input().split()))
ans=0
m=p[0]
for x in p:
  m=min(x,m)
  if x==m:
    ans+=1


print(ans)
n = int(input())
P = list(map(int, input().split()))
P_min = P[0]
cnt = 1

for i in range(n):
    if P_min > P[i]:
        cnt += 1
        P_min = P[i]
print(cnt)
N = int(input())
l = input().split(" ")
P = [int(n) for n in l]

# i=1は必ずOK
c = 1
min = P[0]

for i in range(1,N):
  p = P[i]
  if p<=min:
    c+=1
    min=p
    
print(c)
n = int(input())
lis = list(map(int, input().split()))
inf = 10 ** 15
ans = 0
for i in lis:
    if i < inf:
        ans += 1
        inf = i
print(ans)
n = int(input())
p = list(map(int, input().split()))

m = 2 * 10 ** 5
ans = 0
for pi in p:
    m = min(m, pi)
    if m >= pi:
        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 = min(p[i], num)

print(ans)
import sys


def solve(inp):
    N = int(inp.readline().strip())
    P = list(map(int, inp.readline().strip().split(' ')))

    r = 0
    minp = P[0]
    for p in P:
        if minp >= p:
            r += 1
            minp = p

    return str(r)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  ps = list(map(int, input().strip().split()))
  p_min = 2 * 20**5
  count = 0
  for p in ps:
    if p < p_min:
      count += 1
      p_min = p
  print(count)

if __name__=='__main__':
  main()
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())
p = [int(i) for i in input().split()]

p_min = [p[0],] * n

for i in range(1,n):
    if p_min[i-1] > p[i]:
        p_min[i] = p[i]
    else:
        p_min[i] = p_min[i-1]

print(sum([1 for i in range(n) if p_min[i] >= p[i]]))
N = int(input())
P = list(map(int, input().split()))

cnt = 0
last = float('inf')
for i in range(N):
    if P[i] < last:
        cnt += 1
        last = P[i] 

print(cnt)
N = int(input())
P_ls = 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()))

now = 0
ans = 1
for i in range(1,n):
    if P[now] > P[i]:
        ans += 1
        now = i
    else:
        pass

print(ans)
N,P=int(input()),list(map(int,input().split()))
for i in range(1,N):
    P[i]=min(P[~-i],P[i])
print(len(set(P)))
N = int(input())
P = list(map(int, input().split()))

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

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))
n = int(input())
p=list(map(int, input().split()))
c=0
min=p[0]
for i in range(n):
    if min>=p[i]:
        c+=1
        min=p[i]
print(c)
N = int(input())
P = list(map(int, input().split()))

cnt = 1
chk = P[0]

for p in P:
    if p < chk:
        cnt += 1
        chk = p

print(cnt)
n=int(input())
li=list(map(int,input().split()))
ans=0
tmp=li[0]

for i in range(n):
    if li[i]>tmp:
        ans+=1
    else:
        tmp=li[i]

print(n-ans)
n = int(input())
p = list(map(int, input().split()))
p_min = p[0]
p_sum = 1

# リストの前から最小値を検索
for i in range(1, n):
    
    # 最小値を見つけた場合
    if p_min > p[i]:
        p_sum += 1
        # 最小値を更新
        p_min = p[i]

print(p_sum)
n = int(input())
data = list(map(int, input().split()))

ans = 0

min_ = data[0]
for i in range(n):
    # min_ の更新ができれば ans を更新
    if min_ >= data[i]:
        min_ = data[i]
        ans += 1

print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
P = np.array(read().split(),np.int32)

Q = np.minimum.accumulate(P)

answer = np.count_nonzero(P <= Q)

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

cnt = 1
tmp_min = p[0]
for i in range(1, n):
    tmp_min = min(tmp_min, p[i]) 
    if tmp_min == p[i]:
        cnt += 1
print(cnt)
N = int(input())
P = list(map(int,input().split()))
s, t = 0, 0
for i in range(0,N):
    if P[i] <= P[t]:
        s = s+1
        t = i
print (s)
# -*- coding: utf-8 -*-
"""
Created on Tue Sep  8 02:46:31 2020

@author: liang
"""

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

low = P[0]
count = 0

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

c = [True for i in range(n)]
target = p[0]
for i in range(1,n):
  if p[i]>target:
      c[i] = False
  else:
    target = p[i]
print(sum(c))
#python3
n = int(input())
p = [int(i) for i in input().split()]
MIN = p[0]
cnt = 0

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

print(cnt)
n = int(input())
p = list(map(int,input().split()))
min_p = n+1
ans = 0
for i in range(n):
    if p[i] < min_p:
        ans += 1
        min_p = p[i]
print(ans)
N = int(input())
P = list(map(int, input().split()))
x = N+1
ans = 0
for p in P:
  if x > p:
    ans += 1
    x = p
print(ans)
n=int(input())
samplelist=list(map(int,input().split()))
count=1
compare_variable=samplelist[0]
for i in range(1,n):
  if compare_variable>samplelist[i]:
    compare_variable=samplelist[i]
    count+=1
print(count)
n = int(input())
p = list(map(int, input().split()))

count = 0
m = p[0]
for pi in p:
    if m >= pi:
        count += 1
    m = min(m, pi)
print(count)
N = int(input())
P = list(map(int, input().split()))
MIN = 10 ** 6
cnt = 0
for i in range(N):
  MIN = min(MIN, P[i])
  if MIN >= P[i]:
    cnt += 1
print(cnt)
N = int(input())
num = list(map(int,input().split()))
count = 0
m = num[0]
for _ in range(N):
  if m >= num[_]:
    m = num[_]
    count += 1

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

flag = True
pre_min_p = p[0]
cnt = 0
for i in p:
    if pre_min_p >= i:
        cnt += 1
        pre_min_p = i

print(cnt)
n = int(input())
p = list(map(int, input().split()))
_min = p[0]
for a in p:
    if a > _min:
        n -= 1
    _min = min(a, _min)
print(n)
import sys
import math
input = sys.stdin.readline

N = int(input())

#a, b, c = (int(i) for i in input().split())  
P = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

minnum = P[0]
count = 1
for i in range(1, N):
    if minnum >= P[i]:
        count+=1
        minnum = P[i]
    else:
        pass

print(count)
n, *aa = map(int, open(0).read().split())
# aa = aa
bb = []

tmp = aa[0]
for a in aa:
    tmp = min(a,tmp)
    bb.append(tmp)

# bb = bb[:-1]

print(sum([a<=b for a, b in zip(aa, bb)]))
N=int(input())
P=list(map(int,input().split()))
value=P[0]
count=1
for i in range(1,N):
    #print(P[i])
    if P[i]<=value:
        count+=1
    value=min(P[i],value)
    #print(i,count)
print(count)
n=int(input())
p=list(map(int,input().split()))
m=n+1
ans=0
for i in range(n):
    if p[i]<m:
        ans+=1
        m=p[i]
    else:
        pass
print(ans)
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    P = LI()
    ans = 0
    min_num = P[0]
    for i in range(N):
        if min_num>=P[i]:
            ans += 1
            min_num = P[i]

    print(ans)

main()
import math

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

min_ = math.inf
ans = 0
for p in P:
    ans += p <= min_
    min_ = min(min_, p)
print(ans)
n=int(input())
p= list(map(int, input().split()))
count=0
x=10**9
for i in range(n):
    if p[i]<=x:
        count+=1
        x=p[i]
print(count)
n=int(input())
p=list(map(int,input().split()))
ans=1
x=p[0]
for i in range(1,n):
  if p[i]<x:
    ans=ans+1
    x=p[i]
print(ans)
n = int(input())
p = list(map(int, input().split()))
for i in range(n):
    if i == 0:
        ans = 1
        minp = p[i]
    elif minp >= p[i]:
        ans += 1
        minp = min(minp,p[i])
print(ans)
now_min = 1 << 20

n = int(input())

ans = 0
for p in map(int, input().split()):
    if p < now_min:
        ans += 1
        now_min=p

print(ans)
n=int(input())
p=list(map(int,input().split()))
m=int(2*10e5)
ans=0
for i in p:
    if(i<=m):
        m=i
        ans+=1
print(ans)
n = int(input())
A = list(map(int, input().split()))
num = A[0]
ans = 0
for i in range(0, n):
    if(A[i] <= num):
        ans += 1
    num = min(num, A[i])
print(ans)
import sys
input = sys.stdin.readline
n=int(input())
P=list(map(int,input().split()))
cnt=1
mn=P[0]
for i in range(1,n):
    if mn>=P[i]:
        cnt+=1
        mn=P[i]
print(cnt)
n = int(input())
p = list(map(int, input().split()))

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

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

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

print(count)
#%%
n = int(input())
a = list(map(int, input().split()))
tmp = 10**10
ans = 0
for i in range(n):
    if a[i] <= tmp:
        ans += 1
    tmp = min(tmp, a[i])
print(ans)
n = int(input())
a = list(map(int, input().split()))
r = 1
m = a[0]
for i in a[1:]:
  if m >= i:
    r += 1
  m = min(i, m)
print(r)
a=int(input())
b=list(map(int,input().split()))
c=1
d=b[0]
for i in range(a-1):
    if d>b[i+1]:
        d=min(b[i],b[i+1])
        c=c+1
print(c)
def main():
    N = int(input())
    P = list(map(int, input().split()))
    
    count = 0
    k = 0
    for i in range(N):
        flag = True
        for j in range(k, i):
            if P[i] > P[j]: 
                flag = False
                break

        if flag:
            count += 1
            k = i
            
    print(count)
if __name__ == "__main__":
    main()
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)
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    count = 1
    num = P[0]
    for i in range(1, N):
        if num >= P[i]:
            count += 1
            num = P[i]
    print(count)


if __name__ == "__main__":
    main()
#C - Low Elements
N = int(input())
P = list(map(int,input().split()))

count = 1
target = P[0]
for i in range(1,N):
    if target>P[i]:
        count += 1
        target = P[i]
print(count)
N = int(input())
x =list(map(int,input().split()))
Y = N+1
Z = 0
for i in range(N):
    if Y>x[i]:
        Y = x[i]
        Z +=1
print(Z)
from operator import itemgetter
from math import log,ceil

def main():
    N = int(input())
    P = list(map(int,input().split()))
    mini = P[0]
    cnt = 0
    for p in P:
        if p <= mini:
            cnt += 1
        mini = min(p,mini)
    print(cnt)
    return


if __name__ == "__main__":
    main()
N = int(input())
P = list(map(int, input().split()))
count = 0
minimum = 2 * 10**5
for i in range(N):
    if P[i] <= minimum:
        count += 1
        minimum = P[i]
print(count)
x=input;y=int
n,p=y(x()),list(map(y,x().split()))
for i in range(1,n):p[i]=min(p[~-i],p[i])
print(len(set(p)))
n=int(input())
p=[0]*n
p=list(map(int,input().split()))
dai=p[0]
ans=0
for i in range(n):
  if (dai>=p[i]):
    dai=p[i]
    ans+=1
print(ans)
N = int(input())
Pn = input().split()
Pn = [int(i) for i in Pn]

Pn_min = Pn[0]
count = 0
for i in range(N):
    if(Pn[i] <= Pn_min):
        count = count + 1
        Pn_min = Pn[i]
print(count)
N=int(input())
P=[int(x) for x in input().split()]

min = P[0]
ans = 1

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

print(ans)
n=int(input())
c=n+1
p=list(map(int,input().split()))
an=0
for i in range(n):
    c=min(c,p[i])
    if c>=p[i]:
        an+=1
print(an)
n = int(input())
p = list(map(int, input().split()))
ans = 0
mp = p[0]
for i in range(n):
    if mp >= p[i]:
        ans += 1
        mp = min(mp, p[i])
print(ans)
import sys
input = sys.stdin.readline
N = int(input())
P = [int(i) for i in input().split()]
k = N+10
count = 0
for i in range(N) :
    if k >= P[i] :
        k = P[i]
        count +=1
print(count)
n=int(input())
p_list=list(map(int, input().split()))
num_i=0

minimum=n+1
for p in p_list:
  if p<minimum:
    num_i+=1
    minimum=p
    if p==1:
      break

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

m = p[0]
count = 1
for i in range(1,n):
    if m >= p[i]:
        count += 1
    m = min(m, p[i])
print(count)
n = int(input())
p = list(map(int,input().split()))
cnt = 1
max_p = p[0]
for i in range(1,n):
    if max_p > p[i]:
        max_p = p[i]
        cnt+=1
print(cnt)
N=int(input())
P=list(map(int,input().split()))

p_min=10**10
cnt=0
for p in P:
  if p_min >= p:
    cnt+=1
    p_min=p
    
print(cnt)
n=int(input())
p=list(map(int,input().split()))
cnt=0
min=p[0]

for i in range(n):
  if p[i]<=min:
    cnt+=1
    min=p[i]
    
print(cnt)
n=int(input())
p=[int(i) for i in input().split()]
ans=1
MIN=p[0]
for i in range(1,n):
    if MIN>=p[i]:
        ans+=1
    MIN=min(MIN,p[i])
print(ans)
n = int(input())
p = list(map(int,input().split()))
INF = float("inf")
mini = INF
cnt = 0
for i in range(n):
    if mini>=p[i]:
        cnt += 1
        mini = p[i]
print(cnt)
N = int(input())
P = [-1]
P += list(map(int, input().split(' ')))
mini = 10 ** 9
count = 0
for i in range(1,N+1):
    if P[i] <= mini:
        mini = P[i]
        count += 1
print(count)
n = int(input())
p = list(map(int,input().split()))
ans = 0
currentMin = 10 ** 9
s = []

for i in range(n):
    if currentMin > min(currentMin,p[i]):
        currentMin = min(currentMin,p[i])
        s.append(currentMin)
    else:
        s.append(currentMin)

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

print(ans)
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    P=list(map(int,input().split()))
    ans=0
    minnum=INF
    for p in P:
        if minnum>=p:
            ans+=1
        minnum=min(minnum,p)
    print(ans)
        
        

if __name__ == '__main__':
    main()
n = int(input())
lst = list(map(int, input().split()))
nowmin = 10 ** 9
res = 0
for i in range(n):
  if nowmin >= lst[i]:
    res += 1
    nowmin = lst[i]
print(res)
n = int(input())
p = list(map(int, input().split()))

min_v = float("inf")
ans = 0
for i in range(len(p)):
    if min_v >= p[i]:
        ans += 1
    min_v = min(min_v, p[i])
print(ans)
s=input().split()
n=int(s[0])
s=input().split()
mini=10000000
out=0
for i in range(n):
    if mini>=int(s[i]):
        mini=int(s[i])
        out+=1
print(out)
N = int(input())
p = list(map(int, input().split()))

m =p[0]
ans =0

for i in range(N):
        #print(m, p[i])
        if m >= p[i]:
            ans+=1
            m=min(m, p[i])    
            continue

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

min_n = n+1
ans = 0

for aa in a:
    if min_n > aa:
        ans += 1
        min_n = aa

print(ans)
n=int(input())
p=list(map(int,input().split()))
m=float('INF')
ans=0

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

num = 2*10**5+1
ans = 0
for i in range(n):
    if P[i] <= num:
        num = P[i]
        ans += 1
        
print(ans)
N = int(input())
P = [int(s) for s in input().split()]

min_value = P[0]
ans_count = 0
for i in range(len(P)):
    if P[i] <= min_value:
        ans_count += 1

    min_value = min(min_value, P[i])

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

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

print(ans)
n = int(input())
p = list(map(int, input().split()))
m = 200001
ans = 0
for i in range(n):
  if p[i] <= m:
    m = p[i]
    ans += 1
print(ans)
#!/usr/bin/env python3
n=int(input())
p=list(map(int,input().split()))
count=1
minnum=p[0]
for i in range(1,len(p)):
    if p[i]<=minnum:
        minnum=p[i]
        count+=1
print(count)
n=int(input())
p=list(map(int, input().split()))
ans=1
l=[p[0]]
buf=p[0]
for i in range(1,n):
    l.append(p[i])
    if p[i]<=buf:
        ans+=1
        buf=p[i]
print(ans)
N = int(input())
N_List = list(map(int,input().split()))
ct = 0
Current_Min = 2*(10**5) + 1
for i in range(N):
    if N_List[i] <= Current_Min:
        ct += 1
        Current_Min = N_List[i]
print(ct)
import sys
def input():
    return sys.stdin.readline()[:-1]
N=int(input())
P=list(map(int,input().split()))
t=10**6
a=0
for i in P:
    if i<t:
        a+=1
        t=i
print(a)
N = int(input())
P = list(map(int, input().split()))
Ans = 0
Min = 9999999

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

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

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

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

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