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

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

ans = 0
p_min = P[0]
for i, j in enumerate(P):
    if p_min >= j:
        ans += 1
        p_min = j

print(ans)

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

counter=0
flag=True

a=x[0]
for i in range(N):

    if a>x[i] :
        a=x[i]
    if a<x[i]:
        counter+=1

print(N-counter)

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

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

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

ans = 0
pivot = P[0]

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

print(ans)

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

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

    if P[i] <= n_p:
        ans += 1

    if n_p > P[i]:
        n_p = P[i]
        

print(ans)

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

Solution (Python):
import queue
import copy
import math
from collections import deque


n = int(input())


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

ans = 0
current_min = n + 1

for i in range(0, n):
    if i == 0:
        current_min = pn[i]
        ans += 1
        continue

    if pn[i] < current_min:
        ans += 1
        current_min = pn[i]
        continue

print(ans)

Solution (Python):
N= int(input())
P = [int(i) for i in input().split()] 
C = N
D = P[0]
for i in range(1, N, 1):
	D = min(D,P[i])
	if D != P[i]:
		C -= 1
print(C)

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

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

lim = P[0]+1
ans = 0

for p in P:
    if p <= lim:
        ans += 1
        lim = p

print(ans)

Solution (Python):



n = int(input())

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

m = p[0]
ans = 0

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


print(ans)

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

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

ans = 1
min = p[0]

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

Solution (Python):
import numpy as np

N=int(input())

P=np.array(input().split(" "),dtype=np.int32)

count=1

t=P[0]
for i in range(0,N-1):
    if(t>=P[i+1]):
        t=P[i+1]
        count+=1


print(count)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
count = 0
min_P = P[0]

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

print(count)

Solution (Python):

import sys


def solve(N: int, P: "List[int]"):
    INF = 1001001
    p_min = INF
    cnt = 0
    for pi in P:
        if p_min < pi:
            continue
        else:
            p_min = pi
            cnt += 1
    print(cnt)
    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=list(map(int,input().split()))
ans=0
a=p[0]
for i in range(n):
    if p[i] <= a:
        ans+=1
    
    a=min(a,p[i])    


print(ans)

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

Solution (Python):

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

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

print(cnt)

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

x=a[0]
y=0
for i in range(N):
  if a[i]<=x:
    y+=1
    x=a[i]
print(y)

Solution (Python):
N = int(input())
num = list(map(int,input().split()))
cnt = 0
flag = False
num_min = 10**8
for i in range(N):
	if(i == 0):
		cnt+=1
		continue
	num_min = min(num_min,num[i-1])
	if (num[i] <= num_min):
		cnt+=1
print(cnt)

Solution (Python):
import heapq
a = []
n = int(input())
p_L = list(map(int,input().split()))


heapq.heapify(a)
kotae = 0
for i in p_L:
    heapq.heappush(a, i)
    if i == a[0]:
        kotae += 1

print(kotae)

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

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    n = int(lines[0])
    p = [int(e) for e in lines[1].split(' ')]

    return (n, p)


def solve(n, p):


    result = [] 
    current_min = 200000 + 1
    current_min_index = None
    for i in range(n):

        if current_min < p[i]:
            pass
        else:
           current_min = p[i]
           current_min_index = i

        done = False
        for j in range(current_min_index, i+1):
            if p[i] <= p[j]:
                if j == i:
                    done = True
            else:
                break
        if done:
            result.append(i)


    return len(result)


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        print("%d %d" % (result[0], result[1]))
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

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 = min(m, p[i])
print(count)

Solution (Python):
n = int(input())
arr = [int(j) for j in input().split()]
ma = 99999999999
count = 0
for i in range(n):
	if arr[i] < ma:
		ma = arr[i]
		count += 1
print(count)

Solution (Python):
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

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

Solution (Python):
n=int(input())
a=map(int,input().split())
b,c=2*10**5+1,0
for i in a:
    if i<b:
        c+=1
        b=i
print(c)

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

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
P_min = [2*(10**5)]
for i in range(N-1):
    P_min.append(min(P_min[i],P[i]))
ans = 0
for i in range(N):
    if P_min[i] >= P[i]:
        ans += 1
print(ans)

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

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

print(ans)

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''



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

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys
n = int(input())
lis = list(map(int,input().split()))
count = 0
mi = 0
for i,l in enumerate(lis):
    if i == 0:
        mi = l
        count += 1
    else:
        if l < mi:
            mi = l
        if mi >= l:
            count += 1
print(count)

Solution (Python):
import numpy as np


N = int(input())














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

cnt = 1

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

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

Solution (Python):

n = int(input())
P = [int(x) for x in input().split(" ")]
mx = P[0]
ans = 1
for i in range(1,n):
    if mx > P[i]:
        ans += 1
        mx = P[i]
print(ans)

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

print(cnt)

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

cnt = 1
mi = p[0]

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


print(cnt)

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

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

    if min >= P[i]:
        ans += 1

print(ans)

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

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

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


ans = 1
min_num = p[0]

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

print(ans)

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

def init_min(init_min_val):
    
    for i in range(N):
        seg_min[i+num_min-1]=init_min_val[i]    
    
    for i in range(num_min-2,-1,-1) :
        seg_min[i]=min(seg_min[2*i+1],seg_min[2*i+2]) 
    
def update_min(k,x):
    k += num_min-1
    seg_min[k] = x
    while k:
        k = (k-1)//2
        seg_min[k] = min(seg_min[k*2+1],seg_min[k*2+2])
    
def query_min(p,q):
    if q<=p:
        return ide_ele_min
    p += num_min-1
    q += num_min-2
    res=ide_ele_min
    while q-p>1:
        if p&1 == 0:
            res = min(res,seg_min[p])
        if q&1 == 1:
            res = min(res,seg_min[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = min(res,seg_min[p])
    else:
        res = min(min(res,seg_min[p]),seg_min[q])
    return res


ide_ele_min = 10**10


num_min =2**(N-1).bit_length()
seg_min=[ide_ele_min]*2*num_min
init_min(P)

answer = 1

for i in range(1, N):
    MIN = query_min(0, i)
    if MIN > P[i]:
        answer += 1

print(answer)

Solution (Python):
DEBUG = False

def dprint(*args):
    if DEBUG:
        print(*args)

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

num = 1
num_min = p.pop(0)
dprint(n, num_min, p)

for i in p:
  if i < num_min:
    num_min = i
    num += 1
  dprint(num, num_min)
  if i == 1:
    break

print(num)

Solution (Python):
import sys

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))

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

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

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

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

ans=None

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

ans=count

print(ans)

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

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

Solution (Python):
s=input().split()
n=int(s[0])
s=input().split()
mini=10000000
out=0
for i in range(n):
    if mini>=int(s[i]):
        mini=int(s[i])
        out+=1
print(out)

Solution (Python):
max = int(input())
orgList = list(map(int, input().split()))
min = 999999999999

result = 0;
for i in range(max):
    assertNo = orgList[i]
    if min > orgList[i]-1:
        min = orgList[i]

    if min >= assertNo:
        result+= 1

print(result)

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

Solution (Python):
import heapq

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

a = []
heapq.heapify(a)
ans = 0
for i in p_L:
    heapq.heappush(a, i)
    min_num =  a[0]
    
    if i == min_num:
        ans += 1

print(ans)

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

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

print(ans)

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

ans = 0
min = float('inf')

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

print(ans)

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

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


i_list = [False] * N

min_tmp = p_list[0]

for i in range(N):
    if p_list[i] > min_tmp:
        i_list[i] = False

    else:
        min_tmp = p_list[i]
        i_list[i] = True


ans = i_list.count(True)
print(ans)

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

pmin=[]
pmin.append(pi[0])
for i in range(n-1):
    if pmin[i]>pi[i+1]:
        pmin.append(pi[i+1])
    else:
        pmin.append(pmin[i])


icnt=0
for i in range(n):
    if pi[i]<=pmin[i]:
        icnt=icnt+1
print(icnt)

Solution (Python):
N = int(input())
P = input().split()
count = 0
cur_min = int(P[0])

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

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

print(count)

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

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

cnt = 1
min_p = P[0]
for i in range(1, len(P)):
  if P[i] < min_p:
    cnt += 1
    min_p = P[i]

print(cnt)

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

ans = [1]
mini = P[0] 
for i in range(1, len(P)):
    if mini > P[i]:
        mini = P[i]
        ans.append(i+1)

print(len(ans))

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

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]:
        cnt += 1
        Min = p[i]
print(cnt)

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

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

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

Solution (Python):
import sys
sysinput = sys.stdin.readline

N = int(sysinput())
P = list(map(int, sysinput().split()))
memo_mini = N
i_count = 0
for i in range(0, N):
  if memo_mini >= P[i]:
      i_count +=1
      memo_mini = P[i]
  else:
    pass
  
print(i_count)

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

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

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    P = list(map(int, input().split()))

    p1 = [0] + P
    p2 = [0, P[0]]
    for p in P[1:]:
        p2.append(min(p2[-1], p))
    ans = 0
    for i in p1[1:]:
        if p1[i] <= p2[i]:
            ans += 1
    print(ans)


main()

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

P =list(map(int, input().split()))
count = 1
ini = P[0]

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

print(count)

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

ret = 0
c_min = 2e5

for i in p:
    if c_min >= i:
        c_min = i
        ret+=1
print(ret)

Solution (Python):


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

res = 0
minP = 10 ** 9

for i in range(N):
    if P[i] <= minP:
        res += 1
        minP = P[i]
    else:
        continue

print(res)

Solution (Python):
n = int(input());
p = input().split(' ');

for i in range(n) :
	p[i] = int(p[i]);

dp = [0]*n;
flg = [1]*n;
comp = n+1;

for i in range(1,n) :
	if p[i-1] < p[i] and p[i-1] < comp :
		comp = p[i-1];
	if p[i] > comp :
		flg[i] = 0;


print(sum(flg));

Solution (Python):


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

ans = 0
max = N + 1
for p in P:
    if max > p:
        max = p
        ans += 1

print(ans)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def solve():
    n = II()
    p = LI()
    a = inf
    ans = 0
    for i in range(n):
        ans += a >= p[i]
        a= min(a, p[i])
    print(ans)
    return



if __name__ == '__main__':
    solve()

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

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

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

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

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
min_num = L[0]
count = 0
for x in L:
    if(min_num >= x):
        count +=1
        min_num = x
print(count)

Solution (Python):
N = int(input())
per = [0] + [int(i) for i in input().split()]
res = 0
min_per = per[1]
for i in range(1, N+1):
  min_per = min(min_per, per[i])
  flag = True
  if per[i] > min_per: 
    pass
  else: 
    res += 1
print(res)

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

Solution (Python):
n = int(input())
ns = list(map(int, input().split()))
min_n = float("inf")
count = 0
for i in ns:
    if i < min_n:
        count += 1
        min_n = i
    if i == 1:
        break
print(count)

Solution (Python):
n = int(input())
all_number = input().split()
count = 0
lowest = int(all_number[0])
for i in range(n):
  if(int(all_number[i]) <= lowest):
    count = count + 1
    lowest = int(all_number[i])
print(count)

Solution (Python):


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

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

print(ans)

Solution (Python):
def main():
    N = int(input())
    P = list(map(int,input().split()))
    min_val = 2*10e5
    count = 1
    for i in range(1,N):
        if min_val > P[i-1]:
            min_val = P[i-1]
        if P[i] <= min_val:
            count += 1
    print(count)
if __name__ == '__main__':
    main()

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

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

num = P[0]
ans = 1

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

print(ans)

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

INF = 99999999

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

mins = [INF] * N

ans = 1
mins[0] = P[0]

for i in range(1,N):

    if (mins[i-1] > P[i]):
        ans += 1
        mins[i] = P[i]


    else:
        mins[i] = mins[i-1]

print(ans)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

min_ = pl[0]
ans = 0
for x in pl:
    if x <= min_:
        ans += 1
    if x < min_:
        min_ = x

print(ans)

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

c = [True for i in range(n)]
target = p[0]
for i in range(1,n):
  if p[i]>target:
      c[i] = False
  else:
    target = p[i]
print(sum(c))

Solution (Python):
import sys

N = int(input())
ll=[]
ll = list(map(int, input().split()))

num =0
mi = ll[0]
for i in range(N):
  a = ll[i]
  if mi >= a:
    mi = a
    num += 1

print(num)

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

ans = 0
min_val = Ps[0]
for i,p in enumerate(Ps):
  if p<=min_val:
    ans += 1
    min_val = p
print(ans)

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

Solution (Python):
import copy

N = int(input().strip())
P = list(map(int, input().strip().split()))
ans = 0
min = 1e10
for i in range(N):
  
  
  
  
  
  
  if P[i] < min:
    min = P[i]
    ans += 1
  """
  flag = True
  for j in range(0, i):
    if P[i] > P[j]:
      flag = False
      break
  if flag:
    ans += 1
  """
  
print(ans)

Solution (Python):
def Convert(string): 
    li = list(map(int, string.split(" "))) 
    return li 

N = input().split()
L = Convert(input())
Min = L[0]
Sum = 0

for i in L:
    if i <= Min:
        Sum += 1
        Min = i
        

print(Sum)

Solution (Python):
import sys
N = int(input())
A = list(map(int, input().split())) 
count=0
max=sys.maxsize

for i in A:
    if i<=max:
        count+=1
        max=i
        
print(count)

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

res = 1

minP = P[0]
for i in range(len(P)-1):
    if minP > P[i+1]:
        minP = P[i+1]
        res += 1

print(res)

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

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

print(ans)

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

max_v = p[0]  
min_v = p[0]
ans = 1
for i in range(1, len(p)):
    
    if p[i] <= max_v and p[i] <= min_v:
        ans += 1
        
    if p[i] > max_v:
        max_v = p[i]
    if p[i] < min_v:
        min_v = p[i]
    
print(ans)

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

Solution (Python):
dummy = list(map(int, input().split(" ")))
N = dummy[0]

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

out = 0
min = N + 1
for a in range(N):
    if(P[a] <= min):
        min = P[a]
        out += 1


print(out)

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

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

cnt = 1
p_min = P[0]

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

print(cnt)

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

a = P[0]
x = []
x.append(P[0])
for i in range(1,len(P)):
    if a >= P[i]:
        x.append(P[i])
        a = P[i]
print(len(x))

Solution (Python):


import sys
import math
import time
import numpy as np
import collections
from collections import deque
import queue
import copy


def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z


def bfs(SS, x, y, H, W):
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" 
    for i in range(4): 
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      
      
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" 
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      
  return mlength



N = int(input())
P = str(input()).split()
PP = []

val = 0

for i in range(N):
  PP.append(int(P[i]))

MIN = PP[0]

for i in range(N):
  
  
  MIN = min(MIN, PP[i])
  if(MIN>=PP[i]):
    val += 1

print(val)

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

ll = []
ll.append(l[0])

for i in range(len(l)-1):
  if l[i] > l[i+1]:
    ll.append(min(l[i+1], ll[i]))
  else:
    ll.append(ll[i])

count = 0
for i in range(len(ll)):
  if l[i] <= ll[i]:
    count+=1

print(count)

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

x=a[0]

for i in range(0,n):
  if x >= a[i]:

    x=a[i]
    c+=1
print(c)

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

c = 1
min = 10000000000000
for i in range(N - 1):
    if P[i] < min:
        min = P[i]
    if P[i + 1] <= min:
        c += 1
print(c)

Solution (Python):
from fractions import gcd


import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7



def lcm(a, b):
    return a * b / fractions.gcd(a, b)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors


def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


def modinv(a, mod):
    return modpow(a, mod - 2, mod)


def cnk(a, b):
    MOD = 10**9+7
    ret = 1
    for i in range(b):
        ret *= (a-i)
        ret %= MOD
        ret = ret * modinv(i+1, MOD) % MOD
    return ret




def main():
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

            

    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    


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




    


if __name__ == '__main__':
    main()

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

count = 0
min =99999999

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

print(count)

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


if __name__ == "__main__":
    main()

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

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

ans = 0
min = N

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

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

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

print(ans)