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):
import sys

def main():
    input = sys.stdin.readline

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

    

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

        
        






    '''
    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)
    '''

if __name__ == "__main__":
    main()

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

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

print(cnt)

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

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

for v in p:
  if v < min_num:
    count += 1
    min_num = v
    
print(count)

Solution (Python):
n = int(input())
p_ls = list(map(int,input().split()))
min_ = float('inf')
count = 0
for i in range(n):
    if p_ls[i] < min_:
        count += 1
        min_ = p_ls[i]
print(count)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split(" ")]
count = 0
pmax = max(P)
for i in range(N):
    if P[i]<= pmax:
        pmax=P[i]
        count+=1

print(count)

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

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

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

ans = 0
premin = 10**6
for i in range(N):
    if premin >= A[i]:
        ans += 1
        premin = A[i]

print(ans)

Solution (Python):



import numpy as np



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

minnum = arrP[0]

def func152C(arr,minnum):
    ans = 0
    for i in arr:
        if i <= minnum:
            minnum = i
            ans += 1
        else:
            continue
    return  ans

ans = func152C(arrP,minnum)
print(ans)

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

x = sum(p)
y = 0
for i in p:
  if x >= i:
    x = i
    y += 1
print(y)

Solution (Python):


N = int(input())
P = list(map(int,input().split()))
ans = 0
m = 10**9
for i in range(N):
    if P[i]<=m:
        ans += 1
        m = P[i]
    else:
        pass
print(ans)

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

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

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)

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

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)

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

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

print(ans)

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

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
Min = l[0]
count = 0

for i in range(n):
    if Min >= l[i]:
        Min = l[i]
        count += 1
        
print(count)

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

count = 0
minn = xlist[0]

for i in range(0,n):
    if minn >= xlist[i]:
        count += 1
        minn = xlist[i]
    else:
        pass

print(count)

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

count = 0
minn = xlist[0]

for i in range(0,n):
    if minn >= xlist[i]:
        count += 1
        minn = xlist[i]
    else:
        pass

print(count)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
mi = P[0]
for i in range(N):
    if mi > P[i]:
        mi = P[i]
    if P[i] <= mi:
        cnt += 1
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]
    count += 1   
print(count)

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

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
count = 1
 
if N > 0:
  min = P[0]
  
for i in range(1, N):
  isbreak = False
  
  if min < P[i]:
    continue
  elif min >= P[i]:
    min = P[i]
    count += 1
    continue  
  for j in range(0,i):
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    count += 1
    
print(count)

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

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

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
str_min = p[0]
count = 0
for digit in p:
    if digit <= str_min:
        str_min = digit
        count += 1
print(count)

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

count=0
mi=P[0]  

for i in range(N):
    A=P[i]
    if A<=mi:
        mi=A
        count+=1
    else:
        continue

print(count)

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

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

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

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

print(c)

Solution (Python):

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

Solution (Python):



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

def main():
    import sys
    input = sys.stdin.readline 
    n = int(input())
    p = list(map(int, input().split()))

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

main()

Solution (Python):



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

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

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

main()

Solution (Python):



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

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

Solution (Python):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())
    pl = list(map(int, input().split()))
    minv = n + 1
    ans = 0
    for p in pl:
        if minv > p:
            ans += 1
            minv = p
    print(ans)
    return


if __name__ == '__main__':
    main()

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):
n = int(input())
p = list(map(int, input().split()))

count = 0
mi = p[0]

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

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

Pmin = float("inf")
count = 0
for i in P:
    if i < Pmin:
        Pmin = i
        count += 1

print(count)

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

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

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

tmp = 2**30

ans = 0
for ele in arr:
  if tmp > ele:
    ans += 1
    tmp = ele

print(ans)

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

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

count = 1
num = p[0]
for i in range(1,len(p)):
    if p[i] <= num:
        count += 1
        num = p[i]
        
print(count)

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

ans = 0
now_min = p_list[0]
for i in range(n):
    if now_min > p_list[i]:
        now_min = p_list[i]
    if p_list[i] <= now_min:
        ans += 1
print(ans)

Solution (Python):
f=input
f(); l=map(int,f().split())
a,m=0,200001
for i in l:
  if i<m: m=i; a+=1
print(a)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

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

ans = 0
mi = 1<<60
for i in range(N):
  mi = min(mi, A[i])
  if A[i] <= mi:
    ans += 1    
print(ans)

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

min = P[0]
count = 0
for i in P:
    if min >= i:
        min = i
        count += 1

print(count)

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

min_num = float('inf')
ans = 0

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

print(ans)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

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

Solution (Python):
from sys import maxsize

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

min = maxsize
cnt = 0
for i in p:
    if i <= min:
        min = i
        cnt += 1

print(cnt)

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

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

Solution (Python):
import sys
import math
import itertools as it
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n = i()
p = intl()
cnt = 0
m = p[0]
for i in range(n):
    if m > p[i]:
        m = p[i]
    if p[i] <= m:
        cnt += 1
print(cnt)

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)

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

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
mi = float("inf")
cnt = 0

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

print(cnt)

Solution (Python):
N = int(input())
P_list = list(map(int, input().split(' ')))
min_val = 20 * 10**5 + 1
count = 0
for i in range(N):
    if min_val >= P_list[i]:
        count += 1
        min_val = P_list[i]
print(count)

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

count = 1
for i in range(1, n):
    if P[i] < P[i - 1]:
        count += 1
    else:
        P[i] = P[i - 1]

print(count)

Solution (Python):
N = input()
P = [int(x) for x in input().split()]
mn = 2 * int(1e5) + 1
ans = 0
for pn in P:
    if pn < mn:
        ans, mn = ans + 1, pn
print(ans)

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

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

t = p[0]
ans = 0

for i in p:
  if i <= t:
    ans += 1
    t = i
print(ans)

Solution (Python):






import math





MOD = 10**9 +7
INF = float('inf')





kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret





N = int(input())
l = map(int, input().split())

min = INF
ans = 0
for i in l:
  if i < min:
    min = i
    ans += 1

print(ans)

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

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

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

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

cnt = 1
minv = a[0]
for i in range(1,N):
  if minv > a[i]:
    cnt +=1
    minv = a[i]
print(cnt)

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

m=P[0]
ans=1
for i in range(1,n):
    if m>P[i]:
        ans+=1
        m=P[i]
print(ans)

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

last = p[0]
count = 1

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

print(count)

Solution (Python):
import sys

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

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

ans = 0
mi = 2 ** 60

for i in P:
    if i <= mi:
        ans += 1
    mi = min(mi, i)

print(ans)

Solution (Python):



from math import *
from copy import *
from string import *				
from random import *				
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(l):
	n = len(l)
	minn = l[0]
	ans = 1
	for i in range(1,n):
		if(l[i] <= minn):
			ans += 1
		minn = min(minn,l[i])
	return ans
	

N = int(stdin.readline())
l = list(map(int, stdin.readline().rstrip().split()))



ans = solve(l)
print(ans)

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

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

min_a = A[0]
tot = 1
for i in range(1,N):
  if min_a >= A[i]:
    min_a = A[i]
    tot += 1
print(tot)

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

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


print(ans)

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

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

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

print(count)

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

Solution (Python):
import sys

input = sys.stdin.readline

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

print(ans)

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

Solution (Python):
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]):
        M=P[i]
        cnt+=1



print(cnt)

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

mi=p[0]
b=[0]*n
for i in range(n):
    if mi>p[i]:
        mi=p[i]
    b[i]=mi
print(sum(p[i]==b[i] for i in range(n)))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N,*L = map(int,read().split())
ans = 0
Pj = L[0]
for i in L:
    Pj = min(Pj,i)    
    if Pj >= i:
        ans += 1
print(ans)

Solution (Python):
import numpy as np

num = [input() for i in range(2)]
num_0 = int(num[0])
num_1 = np.array(list(map(int, num[1].split())))

num_min = num_1[0]
count = 1

for i in range(1,num_0):
  if num_1[i] <= num_min:
    count = count + 1
    num_min = num_1[i]
    
print(count)

Solution (Python):

import numpy as np

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

ans = 0

"""
for i, p in enumerate(P):
    
    
        pass
    else:
        ans += 1
"""

"""
自分のラスト回答
P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1
"""

P_min = np.minimum.accumulate(P)

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

Solution (Python):
from itertools import accumulate

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

ans = 0

"""
for i, p in enumerate(P):
    
    
        pass
    else:
        ans += 1
"""

P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1

print(ans)

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

min = n + 1
ans = 0

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

print(ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
min1= 10**6
count = 0
for i in range(1,n):
	if min1 > p[i-1]:
		min1 = p[i-1]
	if min1 >= p[i]:
		
		count+=1

print(count+1)

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

min_a = AS[0]
count = 1
for a in AS[1:]:
  if a < min_a:
    min_a = a
    count += 1
print(count)

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

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

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

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

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

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

ans =1
num = P[0]

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

print(ans)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 +7

n = int(readline())
a = np.array(read().split(),np.int32)

q=np.minimum.accumulate(a)

answer = np.count_nonzero(a<=q)

print(answer)

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

print(cnt)

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

count = 0
min_value = 2*10**5
for i in range(n):
	if min_value >= p[i]:
		count += 1
		min_value = p[i]
print(count)

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

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

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

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

count = 0
min = p[0]

for i in range(N):
    if(min > p[i]):
        min = p[i] 

    if(p[i] <= min):
        count += 1    

print(count)

Solution (Python):
n = input()
plist = map(int, raw_input().split())

ans = 0
vmin = n
for p in plist:
    if vmin >= p:
        vmin = p
        ans += 1

print ans

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

for i in range(n):
  if min >= l[i]:
    cnt += 1
    min = l[i]
print(cnt)

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

ans = 0
min = n + 1

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

print(ans)

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

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

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

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

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)

Solution (Python):
N = int(input())
L = [int(s) for s in input().rstrip().split(' ')]
m = 0 
k = 0
for i in range(len(L)):
  if i == 0:
    m = L[0]
    k += 1
  else:
    if L[i] <= m:
      m = L[i]
      k += 1
print(k)

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

Solution (Python):
N = int(input())
min_p = float('inf')
ans = 0
for p in [int(x) for x in input().split()]:
  if p <= min_p:
    min_p = p
    ans += 1
print(ans)

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

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

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

Solution (Python):
N=input()
arr=input().split()

min=int(arr[0])
cnt=0
for i in range(len(arr)):
    if min >= int(arr[i]):
        cnt+=1
        min = int(arr[i])
print(cnt)

Solution (Python):










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

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

print(ans)

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

cout = 1
saisyou = p[0]

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

print(cout)

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

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

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

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

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


                 
print(ans)

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

Solution (Python):
n = int(input())
a = list(map(lambda x: int(x), input().split()))
pmin = 1e9
cnt = 0
for i in a:
	if i <= pmin:
		cnt += 1
	pmin=min(pmin, i)
print(cnt)

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

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

print(ans)

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

count = 0
minnum = 2*10**5

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

print(count)

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

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

Solution (Python):
from functools import reduce

n = int(input())
v = list(map(int, input().split(' ')))

ans = 0
mini = v[0]
for i in range(len(v)):
    mini = min(mini, v[i])
    if (mini == v[i]):
        ans += 1

print(ans)

Solution (Python):
def get(text,n):
    ans = [""]*n
    i = 0
    for x in text:
        if x==" ":
            i = i + 1
        else:
            ans[i] = ans[i]+x
    return ans

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

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

print(solve(P,N))

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

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

a = 1
mm = P[0]

for i in range(N):
    if mm > P[i]:
        mm = P[i]
        a += 1
    if P[i] == 1:
        break
print(a)

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

count = 1
a = P[0]

for i in range(N-1):
  b = min(a,P[i])
  if b >= P[i+1]:
    count += 1
  a = b
print(count)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
ans = 0
m = float('inf')

for p in P:
    if m > p:
        ans += 1
        m = p
        
print(ans)

Solution (Python):
n=int(input())
*p,=map(int,input().split())
cnt=0
m=[p[0]]
for i in range(1,n):
    m.append(min(m[-1],p[i]))
for i in range(n):
    if p[i]==m[i]:
      cnt += 1
print(cnt)

Solution (Python):
N = int(input())
P = [int(p) for p in input().split()]

min = N + 1
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()))

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

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

Solution (Python):
_ = int(input())
numbers = list(map(int, input().split()))

curr_min = numbers[0]
count = 0
for num in numbers:
    if num <= curr_min:
        count += 1
        curr_min = num

print(count)

Solution (Python):
def count(P, N):
  cnt = 0
  min = P[0]
  M = [0] * N
  for i in range(N):
    if P[i] <= min:
      M[i] = P[i]
      min = P[i]
      cnt += 1
    else:
      M[i] = min
        
  return cnt

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

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

print(ans)

Solution (Python):
n=int(input())
List=list(map(int,input().split()))
newList =[0] * n
count = 0
min = List[0]

for i in List:
    
    if i < min:
        min = i
    
    if min >= i:
        count = count + 1

print(count)

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