Problem:
 Score : 300 points    Problem Statement  Given is a permutation P_1, \ldots, P_N of 1, \ldots, N .
Find the number of integers i  (1 \leq i \leq N) that satisfy the following condition:   For any integer j  (1 \leq j \leq i) , P_i \leq P_j .       Constraints   1 \leq N \leq 2 \times 10^5  P_1, \ldots, P_N is a permutation of 1, \ldots, N .  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  P_1  ...  P_N       Output  Print the number of integers i that satisfy the condition.        Sample Input 1 5
4 2 5 1 3      Sample Output 1 3  i=1 , 2 , and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1 . Similarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.       Sample Input 2 4
4 3 2 1      Sample Output 2 4  All integers i  (1 \leq i \leq N) satisfy the condition.       Sample Input 3 6
1 2 3 4 5 6      Sample Output 3 1  Only i=1 satisfies the condition.       Sample Input 4 8
5 7 4 2 6 8 1 3      Sample Output 4 4       Sample Input 5 1
1      Sample Output 5 1

Solution (Python):
s = [(input().split()) for i in range(2)]
N = int(s[0][0])
t = s[1]
a = 1000000
b = 1
for i in range(N - 1):
    a = min(a,int(t[i]))
    c = int(t[i + 1])
    if a >= c:
        b = b + 1
print(b)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b = 0
mini = 2*(10**5)+10
for x in range(len(a)):
    if a[x] < mini :
        mini=a[x]
        b+=1
print(b)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))

ans = 0
mn = 0

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

print(ans)

Solution (Python):
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])
    
    ans = 0
    for i in range(N):
        ans += a[i] <= mins[i]
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
p = list(map(int, input().split()))

m =p[0]
ans =0

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

print(ans)

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

Solution (Python):
N = int(input())
p = list(map(int,input().split()))
M = p[0]
count = 1
for i in range(1,N):
  M = min(M,p[i])
  count += int(M==p[i])
print(count)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

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

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

Solution (Python):
n = int(input())
arr = input().split(' ')
arr = [int(i) for i in arr]
count = 0
minimum = arr[0]
for idx in range(n):
  num = arr[idx]
  if num <= minimum:
    minimum = num
    count += 1
print(count)

Solution (Python):
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)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
mini = float("inf")
ans = 0
for p in P:
    if p <= mini:
        ans += 1
        mini = p
print(ans)

Solution (Python):
n,*p=map(int,open(0).read().split())
for i in range(1,n):p[i]=min(p[~-i],p[i])
print(len(set(p)))

Solution (Python):
x,y=input,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)))

Solution (Python):
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)))

Solution (Python):
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)))

Solution (Python):
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)))

Solution (Python):
n,p=int(input()),list(map(int,input().split()))
for i in range(1,n):p[i]=min(p[i-1],p[i])
print(len(set(p)))

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
count = 0
min_int = 2 * 10**5
for i in range(0, N):
    if P[i] <= min_int:
        count += 1
        min_int = P[i]

print(count)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
for i in range(1,n):p[i]=min(p[i-1],p[i])
print(len(set(p)))

Solution (Python):
n=int(input())
p=[int(i) for i in input().split()]
for i in range(1,n):p[i]=min(p[i-1],p[i])
print(len(set(p)))

Solution (Python):
n=int(input())
p=[int(i) for i in input().split()]
for i in range(n):
    if i!=0:p[i]=min(p[i-1],p[i])
print(len(set(p)))

Solution (Python):
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)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

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

print(ans + 1)

Solution (Python):
n=int(input())
s = list(map(int, input().split()))
count=0
jmin=n
for i in range(len(s)):
    if s[i]<=jmin:
        jmin=s[i]
        count+=1
print(count)

Solution (Python):
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)

Solution (Python):
N=int(input())
S=list(map(int, input().split()))
Min=2*(10**5)
ans=0
for i in S:
  if Min>=i:
    Min=i
    ans+=1
    
print(ans)

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

pmin = N
cnt = 0

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

print(cnt)

Solution (Python):
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
            
print(cnt)

Solution (Python):



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()

Solution (Python):

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 
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)

Solution (Python):
N = int(input())
input_v_list = list(map(int, input().split()))

cnt = 0             
min_var = 2 * 10**6 


for i in input_v_list:
    
    
    if(min_var > i):
        min_var = i

    
    if(i <= min_var):
        cnt += 1


print(cnt)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

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

print(count)

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

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
a = 10**9
ans = 0
for i in range(n):
    if p[i]<=a:
        ans+= 1
        a = p[i]
print(ans)

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

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min = p[0]

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

print(ans)

Solution (Python):



def main():
    n = int(input())
    p = list(map(int, input().split()))
    value_min = float('inf')
    ans = 0

    for pi in p:
        if value_min > pi:
            ans += 1
            value_min = pi

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def S_():
    return input()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=0


ans=0

n=I()
a=LI()

m=inf
for i in a:
    if i<=m:
        ans+=1
    m=min(i,m)

print(ans)

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

Solution (Python):
N = int(input())
Ps = list(map(int,input().split()))
ans = 0
minP = N
for p in Ps:
    if p <= minP:
        ans += 1
    minP = min(minP, p)
print(ans)

Solution (Python):
N, *P = map(int, open(0).read().split())
ans = 0
cur = int(1e9 + 7)
for p in P:
    ans += 1 if p <= cur else 0
    cur = p if p < cur else cur
print(ans)

Solution (Python):

n = int(input())
P = list(map(int, input().split()))
mn = 1e+7
ans = 0
for p in P:
    if (p<mn):
        mn = p
        ans += 1
    else:
        pass
print (ans)

Solution (Python):
from itertools import accumulate
N = int(input())
P = list(map(int, input().split()))

ans = 0
accmin = accumulate(P, min)
for i, j in zip(P, accmin):
    if i <= j:
        ans += 1
print(ans)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
min_p = n
ans = 0
for i in p:
    if i <= min_p:
        ans += 1
        min_p = i
print(ans)

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

ans = 0
minP = N
for p in P:
    if p <= minP:
        ans += 1
    minP = min(minP, p)

print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
min_val = P[0]
cnt = 1
for p in P[1:]:
    if min_val >= p:
        cnt += 1
    min_val = min(min_val, p)
print(cnt)

Solution (Python):
N = int(input())
list = [int(i) for i in input().split()]

ans = 0
min = list[0]

for j in range(N):
    if (min  >= list[j]):
        ans += 1
        min = list[j]
    else:
        continue

print(ans)

Solution (Python):

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(ans)

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
ans = [0]*n
ans[0] = lst[0]
for i in range(1, n):
  ans[i] = min(ans[i - 1], lst[i])
print(len(set(ans)))

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

cnt = 0
min = N + 1
flag = True

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

print(cnt)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import numpy as np

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

Q = np.minimum.accumulate(P)

print(np.count_nonzero(P <= Q))

Solution (Python):
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    tmp = arr[0]
    counter = 0
    for i in arr:
        if i<=tmp:
            tmp=i
            counter += 1
    print(counter)

if __name__ == "__main__":
    resolve()

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


min = P[0]
cnt = 0

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

print(cnt)

Solution (Python):

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

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
MIN=10**6
res=0
for i in P:
    if i<=MIN:
        MIN=i
        res+=1
print(res)

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
mn=99999999999
c=0
for i in range(n):
    if l[i] <= mn:
        mn=l[i]
        c=c+1
print(c)

Solution (Python):
n = int(input())
pl = list(map(int, input().split()))

minNum = 2 * 10 ** 5
count = 0

for p in pl:
    if p <= minNum:
        minNum = p
        count += 1

print(count)

Solution (Python):
N=int(input())
P=[int(_) for _ in input().split()]
M=[0]*N
M[0]=P[0]

c=1
for i in range(1,N):
  if M[i-1]>=P[i]:
    c+=1
    M[i]=P[i]
  else:
    M[i]=M[i-1]

print(c)

Solution (Python):
n = int(input())

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

d = p[0]
ans = int(0)

for x in p:
  if d >= x:
    ans += 1
    d = x

print(ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]

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

print(count)

Solution (Python):
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    count = n

    min = num_list[0]

    for i in range(1,n):
        if num_list[i] > min:
            count -= 1
        if num_list[i] < min:
            min = num_list[i]

    print(count)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
array = [int(n) for n in input().split()]
count,m = 1,array[0]
for k in range(1,n):
  if array[k] < m:
    m = array[k]
    count = count + 1
print(count)

Solution (Python):

from itertools import accumulate


def main():
    N, *P = map(int, open(0).read().split())
    ans = sum(i <= j for i, j in zip(P, accumulate(P, min)))
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
stan = float("inf")
ans = 0
for i in range(N):
    if stan  >= P[i]:
        stan = P[i]
        ans += 1
    else:
        pass
print(ans)

Solution (Python):
import numpy as np
def main():
    n = int(input())
    p = list(map(int, input().split()))
    c = 0
    mi = 2*10**5+1
    for i in range(n):
        if mi > p[i]:
            c += 1
            mi = p[i]
    
    print(c)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

M = L[0]
count = 0

for i in range(N):
  M = min(M, L[i])
  if M >= L[i]:
    count += 1
print(count)

Solution (Python):
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)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
min = l[0]
c = 0
for i in range(n):
    if l[i] <= min:
        c = c + 1
        min = l[i]
print(c)

Solution (Python):
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)

Solution (Python):
n = int(input())
m = [int(i) for i in input().split()]
mi = 2*10**5+1
h = 0

for i in range (n):
  if mi>m[i]:
    mi=m[i]
    h+=1

    
print(h)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
N = int(input())
Ps = list(map(int,input().split()))

min_val = Ps[0]
ans = 0

for P in Ps:
    if min_val >= P:
        ans += 1
        min_val = P

print(ans)

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
b=N
a=0
for i in range(N):
  if P[i]<=b:
    b=P[i]
    a+=1
print(a)

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
mi=10**9
cnt= 0
for i in A:
  if mi>i:
    cnt+=1
    mi=i
print(cnt)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b,count = [],0
mv = a[0]
for i in range(0,n,1):
    b.append(a[i])
    if(a[i] <= mv):
        count += 1
        mv = a[i]
print(count)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
ans = 1
P0 = P[0]

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

Solution (Python):
n = int(input())
p = list(map(int,input().split()))

ans = 0
l = 10 ** 10

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

print(ans)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
mini = N+1
ans = 0
for i in range(N):
    if P[i] < mini:
        mini = P[i]
        ans += 1
print(ans)

Solution (Python):
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)

Solution (Python):

def main():
    N, *P = map(int, open(0).read().split())
    ans, cur_min = 0, P[0]
    for i in P:
        if i <= cur_min:
            ans += 1
            cur_min = i
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

def main():
    N, *P = map(int, open(0).read().split())
    ans, cur_min = 0, P[0]
    for i in P:
        if i <= cur_min:
            ans += 1
        cur_min = min(cur_min, i)
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
"""
1以上前提
配列番号(j<=i)であるとき
配列要素がi<=jとなる個数

1~iまでで中身が降順であるかどうか
すなわち、探索範囲での先頭が最小かどうかを調べればいい。

問題文3行目より、必ずj,iは1番目を探索しなければならない。
"""
res = 0
before = 10**9 
for i in range(N):
    if P[i] < before:
        before = P[i]
        res += 1
else:
    print(res)

Solution (Python):
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)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
cnt = 0
m = N + 1
for i in range(N):
    if A[i]<m :
        cnt += 1
        m = A[i]
print(cnt)

Solution (Python):
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)

Solution (Python):
iterate = int(input())
p = [int(x) for x in input().split()]

result_sum = 0
prev_min = 10  ** 9
for i in range(iterate):
  if p[i] <= prev_min:
    	result_sum += 1
  prev_min = min(prev_min, p[i])

print(result_sum)

Solution (Python):
n=int(input())
l=list(map(int, input().split()))
cnt=1
nmin=l[0]
for i in range(1,n):
	if nmin>=l[i]:
		cnt+=1
		nmin=l[i]
print(cnt)

Solution (Python):
N = int(input())

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

min = None
count = 0

for idx, num in enumerate(nums):
    if idx == 0:
        min = num
        count += 1
        continue

    if min >= num:
        count += 1
        min = num

print(count)

Solution (Python):
def pred(i, lst, offset):
  for cmpd in lst[offset:i+1]:
    if lst[i] > cmpd:
      return False
  return True

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

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








print(sum)

Solution (Python):
N = int(input())

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

cnt = 1
m = P[0]
for i in P[1:]:
  if i < m:
    m = i
    cnt += 1

print(cnt)

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

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

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

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
mi = p[0]
ans = 0
for i in p:
    if i > mi:
        pass
    else:
        ans += 1
        mi = i
print(ans)

Solution (Python):
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=p[i]
print(count)

Solution (Python):
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)

Solution (Python):
N = int(input())
n_list = list(map(int, input().split()))

minNum = N

ans = 0
for n in range(N):
  minNum = min(n_list[n], minNum)  
  if(minNum == n_list[n]):
    ans += 1
print(ans)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
mn = a[0]
ans = 0
for i in range(n):
    if a[i] <= mn:
        ans += 1
    mn = min(mn, a[i])
print(ans)

Solution (Python):
n = int(input())
p = [int(x) for x in input().split()]
ans = 0
mn = n
for i in p:
  if mn > i:
    mn = i
  if mn >= i:
    ans += 1
print(ans)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
mn = a[0]
ans = 0
for i in range(n):
    if a[i] <= mn:
        ans += 1
    mn = min(mn, a[i])
print(ans)

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

Solution (Python):


n=int(raw_input())
p=map(int,raw_input().split())
cnt=0
x=float('inf')
for i in p:
 if i<=x:
  x=i
  cnt+=1
print cnt

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()
a = l()
ma = Max
co = 0
for i in range(n):
    if a[i] < ma:
        ma = a[i]
        co += 1
print(co)

Solution (Python):
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

Solution (Python):
n=int(input())
s=list(map(int,input().split()))
 
ans=0
smin=s[0]
for i in range(n):
    if s[i]<=smin:
        ans+=1
        smin=s[i]
    
print(ans)

Solution (Python):
def solve(string):
    n, *p = map(int, string.split())
    ans = 0
    m = n + 1
    for _p in p:
        if _p < m:
            ans += 1
            m = _p
    return str(ans)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
import sys
input = sys.stdin.readline
N=int(input())
P=list(map(int,input().split()))
count = 0
saisyouti = P[0]
for i in range(N):
    if P[i]<=saisyouti:
        count += 1
        saisyouti=P[i]
print(count)

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

Solution (Python):
import numpy as np

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

mi = np.minimum.accumulate(p)
print(np.count_nonzero(p<=mi))

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

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

Solution (Python):
n = int(input())
P = list(map(int, input().split()))

mini = float('INF')

count = 0
for num in P:
    if mini >= num:
        count += 1
        mini = num
    else:
        continue

print(count)

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

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

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

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
mi = 10 ** 6
cnt = 0
for i in p:
    if mi > i:
        cnt += 1
        mi = i

print(cnt)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))

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

print(ans)

Solution (Python):
N = int(input())
Plist = list(map(int, input().split()))
ans = 0
M = Plist[0]
for i in range(N):
    M = min(M, Plist[i])
    if Plist[i] == M:
        ans += 1
print(ans)

Solution (Python):
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)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
cnt = 1
min = l[0]
for i in range(1, len(l)):
    if min > l[i]:
        min = l[i]
        cnt += 1
print(cnt)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
count=0
low=A[0]
for i in range(len(A)):
    if low>=A[i]:
        count+=1
    low=min(low,A[i])
print(count)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
t = n+1
cnt = 0
for x in l:
  if x < t:
    t = x
    cnt += 1
print(cnt)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
t=10**10
c=0
for a in A:
    if(a<=t):
        c+=1
        t=a
print(c)

Solution (Python):
n = int(input())
P = list(map(int, input().split()))

com = P[0]
cnt = 1

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

print(cnt)

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

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

print(ans)

Solution (Python):
import numpy as np
n = int(input())
l = np.array([int(i) for i in input().split()])

q = np.minimum.accumulate(l)
ans = np.count_nonzero(l <= q)

print(ans)

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
tmin = p[0]
res = 0
for sp in p:
    if tmin>=sp:
        res += 1
        tmin = sp
print(res)

Solution (Python):
N = int(input())
P = list(map(int, input().split(" ")))
m = [P[0]]
for i in range(1, N):
  if P[i] < m[-1]:
    m.append(P[i])
print(len(m))

Solution (Python):
N = int(input())
P = list(map(int, input().split(" ")))
m = P[0]
c = 1
for i in range(1, N):
  if P[i] < m:
    c += 1
    m = P[i]
print(c)

Solution (Python):
N = int(input())
Ps = list(map(int, input().split()))
count = 0
min = Ps[0]+1

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

print(count)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
MIN = n+1
count = 0
for i in range(n):
    if MIN > p[i]:
        count += 1
    MIN = min(MIN,p[i])
print(count)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
curMin = float("inf")
ans = 0
for x in P:
    curMin = min(curMin, x)
    if curMin == x:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for _ in p:  
    if _ <= n:
        cnt += 1
        n = _
print(cnt)

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

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

ans = 0
min = 10000000

for p in P:
  if min > p:
    ans += 1
    min = p

print(ans)

Solution (Python):
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)