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

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

print(ans)

Solution (Python):
import sys


def main():
    n = int(sys.stdin.readline().strip())
    p = [int(num_s) for num_s in sys.stdin.readline().strip().split(' ')]

    smallest = float('inf')

    ans = 0
    for pi in p:
        if pi <= smallest:
            ans += 1
        smallest = min(smallest, pi)
    print(ans)


if __name__ == '__main__':
    main()

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

smallest = p[0]
omitted = 0
for i in range(1,n):
    if p[i] > smallest:
        omitted += 1
    else:
        smallest = p[i]


print(n - omitted)

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

ans = 1
index = P[0]

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


print(ans)

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

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

Solution (Python):
n = int(input())
A = [int(x) for x in input().split()]

res = 0
mn = 1e1000

for a in A:
    if mn >= a:
        res += 1
    mn = min(mn, a)
print(res)

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

lowest = 2 * 10 ** 5 + 1000
cnt = n
for i in range(n):
    if lowest < p[i]:
        cnt -= 1
    lowest = min(lowest, p[i])
print(cnt)

Solution (Python):
import numpy as np

N = int(input())
S = input()
Ps = np.fromstring(S, dtype=int, sep=" ")

min_val = Ps[0]
count = 1
for i in range(1, N):
    if min_val >= Ps[i]:
        count += 1
        min_val = Ps[i]

print(count)

Solution (Python):
import sys
from collections import defaultdict
from collections import deque
import numpy as np
import heapq
from heapq import heappush, heappop



readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

mn = N+1
cnt = 0
for i in range(N):
    
    a = A[i]

    if a < mn:
        mn = a
        cnt += 1

print(cnt)

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

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

ans = 0
m = float("inf")
for p in P:
    if p <= m:
        ans += 1
    m = min(m, p)

print(ans)

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):
    if P[i]<=M[i]:
        ans+=1
print(ans)

Solution (Python):
import numpy as np

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


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

print(counter)

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

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

min_p = 1*10**9-1
MIN_P_LIST = []
for p in P:
    MIN_P_LIST.append(min_p)
    min_p = min(min_p, p)




ans = 0
for p, m_p in zip(P, MIN_P_LIST):
    if m_p >= p:
        ans += 1 
        
print(ans)

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

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

print(ans)

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

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

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

MIN = 10**9

cnt = 0
for p in P:
    if MIN >= p:
        cnt += 1
        MIN = p

print(cnt)

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

Solution (Python):
import sys
import bisect
n = int(input())
p_ls = [int(i) for i in sys.stdin.readline().split()]
ls = [10**18]
_min = 10**18
cnt = 0
for p in p_ls:
    if p <= _min:
        cnt += 1
        _min = p
print(cnt)

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

cnt = 0
min_j = float("inf")
for i in p:
    if i <= min_j:
        cnt += 1
    min_j = min(min_j, i)

print(cnt)

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

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

minp = p[0]
ans = 1

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

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

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

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

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

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

Solution (Python):

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

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

sum = 0
min = 2*(10**5) + 1
for i in range(N):
  if min >= P[i]:
    sum = sum + 1
    min = P[i]

print(sum)

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

Solution (Python):




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 = ans + 1


print(ans)

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

minNum = nums[0]
count = 0
for i in range(N):
    minNum = min(minNum, nums[i])
    if minNum >= nums[i]:
        count += 1
print(count)

Solution (Python):

 
import math
import itertools
import sys
import copy
 





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

max = P[0]
sum = 1
for i in range(1, N) :
  if max > P[i] :
    max = P[i]
    sum += 1
print (sum)

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

ans = 0
a = 2 * 10 ** 5 + 1
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()))

border = N + 1
ans = 0

for i in P:
    if i < border:
        ans += 1
        border = i

print(ans)

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

r = 1
old = P[0]
new = 0
for i in range(N-1):
    new = P[i+1]
    if (new < old):
        r += 1
        old = P[i+1]


print(r)

Solution (Python):
def main():
    n=int(input())
    P=tuple(map(int,input().split()))
    c=0
    m=P[0]
    for p in P:
        if m>=p: c += 1
        if p==1: break
        m=min(m,p)
    print(c)
main()

Solution (Python):
def run():
  N = int(input())
  P_li = list(map(int, input().split()))
  smallest = P_li[0]
  ans = 0
  for p in P_li:
    if smallest >= p:
      ans += 1
      smallest = p
    else:
      continue
  print(ans)
    

if __name__ == '__main__':
  run()

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

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

print(count)

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

    ans = 0
    min_element = p[0]

    for p_i in p:
        if p_i <= min_element:
            ans += 1
            min_element = p_i

    print(ans)
    
resolve()

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

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

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

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

print(count)

Solution (Python):
n = int(input())
num_list = list(map(int, input().split(" ")))
min = 200001
count = 0

for i in num_list:
    if min >= i:
        count += 1
        min = i

print(count)

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

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]

print(ans)

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

print(cnt)

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

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

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

print(cnt)

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

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

print(res)

Solution (Python):
N = int(input())
perm = [i for i in map(int,input().split())]
perm_new = [perm[0]]
import heapq
heapq.heapify(perm_new)
ans = 1
for i in range(1,N):
  now_min = heapq.heappop(perm_new)
  if now_min >= perm[i]:
    ans += 1
  heapq.heappush(perm_new,now_min)
  heapq.heappush(perm_new,perm[i])
  
print(ans)

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

print(count)

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

m = 200001
ans = 0

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

print(ans)

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

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

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

Solution (Python):
from heapq import heappop, heappush
N = int(input())
P = list(map(int, input().split()))

heap = []
count = 0

for i in range(N):
    heappush(heap, P[i])
    minimum = heappop(heap)
    if minimum >= P[i]:
        count += 1
    heappush(heap, minimum)

print(count)

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

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

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

print(ans)

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

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

print(ans)

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

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

Solution (Python):
import numpy as np
 
N = int(input())
P = list(map(int, input().split()))

cnt = 0
minimum = np.inf

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

print(cnt)

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

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

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

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

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

x_min = P[0]
ans = 1

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

print(ans)

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

m=a[0]
ans=0
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()))

ls = [p[0]]
ans = 1

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

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

print(ans)

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

max_P = float('inf')
count = 0
for i in range(len(P)):
    if P[i] <= max_P:
        count +=1
        max_P = P[i]

print(count)

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

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

print(ans)

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

mn = P[0]
ans = 1
for x in P[1:]:
    if mn >= x:
        mn = x
        ans += 1
    else:
        pass

print(ans)

Solution (Python):

import sys


def solve(N: int, P: "List[int]"):
    ans=1
    mi=P[0]
    for i in range(1,N):
        if P[i]<=mi:
            ans+=1
            mi=P[i]
            
    print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    P = [int(next(tokens)) for _ in range(N)]  
    solve(N, P)

if __name__ == '__main__':
    main()

Solution (Python):


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

pmin = P[0]
res = 1

for j in range(1, n):
    if P[j] <= pmin:
        res += 1
        pmin = P[j]

print(res)

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

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

print(buf_2)

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

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

min = 10**9
result = 0

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

print(result)

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

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

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

ans = 0

mi = p[0]
for i in p:
    
    if mi >= i:
        ans += 1
        mi = i

print(ans)

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

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
comp=10**6
ans=0
for i in A:
    if i<comp:
        comp=i
        ans+=1

print(ans)

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

inf = 10 ** 9

Q = [inf] * N

m = inf

con = 0

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

print(con)

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

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

ans = 0
min = 200007
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=2*(10**5)+1
ans=0
for i in p:
  if c>i:
    ans+=1
    c=i
print(ans)

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

minn=S[0]
count=0
for i in range(len(S)):
    if minn>=S[i]:
        count=count+1
        minn=S[i]
print(count)

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

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

ans = 0
m = P[0]

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

Solution (Python):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

N = one_int()

P=many_int()

count=0
mins=100000000
for i in range(N):
    flg=True
    if P[i]<mins:
        count+=1
        mins=P[i]

print(count)

Solution (Python):
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, *P = map(int, read().split())
P = np.array(P)

acc = P[0]
cnt = 0
for p in P:
    if acc >= p:
        cnt += 1
    acc = min(acc, p)

print(cnt)

Solution (Python):
import sys




args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False




input = sys.stdin.readline
N = int(input())

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

mind = [None for _ in range(N)]
mind[0] = Ps[0]

for i in range(1, N):
  mind[i] = min(mind[i-1], Ps[i])


count = 0
for i in range(0, N):
  if mind[i] >= Ps[i]:
    count += 1

print(count)

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

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

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

curmin = 10000000000
ans = 0

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

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
num=1
c=b[0]
for i in range(a-1):
    if c>=b[i+1]:
        num+=1
        c=b[i+1]
print(num)

Solution (Python):
cnt = 0

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

max = 100000000000

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

print(cnt)

Solution (Python):
import numpy as np
N = int(input())
M = list(map(int, input().split()))
_min = np.inf
ans = 0

for i in range(N):
    if _min > M[i]:
        ans += 1
    _min = min(_min, M[i])

print(ans)

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

minv = arr[0]
cnt = 0
for v in arr:
    if v <= minv:
        cnt += 1
        minv = v

print(cnt)

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

Solution (Python):
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())
l = [int(x) for x in input().split()]
t_min = N + 1
ans = 0
for i in range(N):
  if l[i] < t_min:
    ans += 1
    t_min = l[i]
  elif t_min == 1:
    break
print(ans)

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

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

print(count)

Solution (Python):
n, a = input(), map(int, raw_input().split())
mi = n + 1
ans = 0
for i, x in enumerate(a):
    if mi > x:
        ans += 1
    mi = min(mi, x)
print ans

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

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

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

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

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

cur_min = P[0]
cnt = 1

for p in P[1:]:
    cur_min = min(cur_min, p)

    if p <= cur_min:
        cnt += 1

print(cnt)

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

res = 0
min_sofar = P[0]
for p in P:
    if p <= min_sofar:
        res += 1
    if p < min_sofar:
        min_sofar = p

print(res)

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

min_num = 2 * 10**5 + 1

count = 0

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

print(count)

Solution (Python):

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

ans = 0
now = P[0]

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


print(ans)

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

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

count=0
min_number=P[0]

for i in range(N):
   if min_number<P[i]:
      pass
   else:
      min_number=P[i]
      count+=1

print(count)

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

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

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

Solution (Python):
MAX = 2 * (10**5) + 1


def main():
    N = int(input())
    ps = list(map(int, input().split()))

    min_i = []
    current_min = MAX
    for p in ps:
        if p < current_min:
            current_min = p

        min_i.append(current_min)

    ans = 0
    for tmp_min, p in zip(min_i, ps):
        if tmp_min >= p:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

m=P[0]
count=0
for p in P:
    if m >= p:
        count+=1

    m=min(m,p)

print(count)

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

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

min_ = px[0]
cnt = 1
for i in range(1, len(px)):
    min_ = min(px[i-1], min_)
    
    if min_ > px[i]:
        cnt += 1
print(cnt)

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

    ans = 0
    current_min = 2 * 10 ** 5 + 1

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from pprint import pprint

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

    print(ans)

if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    p = list(map(int,sys.stdin.readline().strip().split(" ")))
    
    solve(n, p)

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

min_num = float("inf")
result = 0
for P in Ps:
    if P < min_num:
        result += 1
        min_num = P

print(result)

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

l=float("inf")
ans = 0
for i in range(N):
  l = min(l,P[i])
  if P[i]<=l:
    ans+=1
print(ans)

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

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

  print(ans)

if __name__ == "__main__":
	main()

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

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
p_min = [10 ** 18 for _ in range(n)]

p_min = p[0]
count = 1
for i, p_i in enumerate(p):
    if 0 == i:
        continue
    p_min = min(p_i, p_min)
    if p_i == p_min:
        count += 1
print(count)

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

minNum = P[0]
ans = 0
for i in range(len(P)):
    if(P[i] <= minNum):
        ans += 1
        minNum = P[i]
    
print(ans)

Solution (Python):
MAX = float('inf')

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

min_a = [MAX]*n
min_a[0] = pp[0]

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

print(ans)

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

x = p[0]
ans = 0
for i in p:
    if x >= i:
        ans += 1
        x = i

print(ans)

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]
a = 200000
b = 0
for i in range(N):
    if a >= P[i]:
        a = P[i]
        b = b + 1
print(b)

Solution (Python):


n = int(input())
nums = map(int, input().split(' '))

minv = 10000000000000
cnt = 0
for num in nums:
    if minv > num:
        cnt += 1
        minv = num
print(cnt)

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

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

print(ans)

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

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

print(ans)

Solution (Python):

import numpy as np


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

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

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

print(ans)

Solution (Python):
N = int(input())
P_list = list(map(int, input().split()))
lownum = P_list[0]
count = 1
for i in range(N-1):
    temp = P_list[i+1]
    if temp <= lownum:
        count = count + 1
        lownum = temp
print(count)

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
min_num = lst[0]
cnt = 0
for x in lst:
    if x <= min_num:
        cnt += 1
        min_num = x

print(cnt)

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

cnt = 0
R = []
for i in range(N):
    if i == 0:
        cnt += 1
        last = P[i]
    else:
        if last > P[i]:
            cnt += 1
            last = P[i]

print(cnt)

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

Solution (Python):
import numpy as np
n = int(input())
p = np.array(list(map(int, input().split())))
ans = 1
min_n = p[0]
for i in range(1, n):
    min_n = min(min_n, p[i-1])
    if p[i] <= min_n:
        ans += 1
print(ans)

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

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

m = p[0]
n = 0
for _p in p:
    if m >= _p:
        n += 1
        m = _p

print(n)

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

Solution (Python):
n = int(input())
li = list(map(int, input().split()))
li_a = []
li_a.append(li[0])
for i in range(1, n):
  if li[i] < li_a[-1]:
    li_a.append(li[i])
print(len(li_a))

Solution (Python):
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    Pn = [int(x) for x in stdin.readline().rstrip().split()]
    min_ = 200001
    count = 0
    for x in Pn:
        if x <= min_:
            min_ = x
            count += 1
    print(count)


if __name__ == "__main__":
    main()