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 = 10**6
 
for i in range(N):
    min_num = min(min_num, P[i])
    if min_num >= P[i]:
        ans += 1
        
print(ans)

Solution (Python):

N = int(input())
P = list(map(int, input().split()))
ans = 0
min_num = 10**6

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

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

counter=0
minimum = 10000000
for i in range(N):
    minimum = min([minimum,lis[i]])
    counter += int(lis[i] <= minimum)
print(counter)

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

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

min = None
count = 0

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

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

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

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

Solution (Python):
N = int(input())
L = [_ for _ in map(int,input().split())]
res = 0
for x in L:
  if x <= N:
    res += 1
    N = x 
print(res)

Solution (Python):
import numpy as np
import sys

count=0
N=int(sys.stdin.readline().rstrip())
P=[int(i) for i in sys.stdin.readline().split()]
minval=np.max(P)
for i in range(0,N):
  if minval>=P[i]:
    minval=P[i]
    count+=1
print(count)

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

Solution (Python):
n=int(input())
P=list(map(int,input().split()))
mn=2*10**5+1
cnt=0

for item in P:
  if mn>item:
    cnt+=1
    mn=item
print(cnt)

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

minLeft = [a[0]] + [None] * (n - 1)
for i in range(1, n):
    minLeft[i] = min(minLeft[i - 1], a[i])
ret = 1
for i in range(1, n):
    ret += a[i] < minLeft[i - 1]
print(ret)

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

count = 0
p_min = 2 * 10 ** 5

for p in p_list:
  if p_min >= p:
    count += 1
    p_min = p

print(count)

Solution (Python):
import math

n = int(input())
ps = map(int, input().split())

minNum = 300000
ans = 0
for p in ps:
    minNum = min(minNum, p)
    if minNum == p:
        ans += 1

print(ans)

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

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

Solution (Python):
from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10**5+10
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]

def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))

def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))

def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD

    return (num*(pow(den,MOD-2,MOD)))%MOD

def flush():
    return sys.stdout.flush()

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
n = int(input())
a = arrIN()

heap = []
heappush(heap,a[0])
ans = 1
for i in range(1,n):
    x = heappop(heap)
    if x>a[i]:
        ans+=1
    heappush(heap,x)
    heappush(heap,a[i])
print(ans)

Solution (Python):
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = 1 
    najmniejszy_dotychczas = P[0]
    for i in range(1,N):
        if P[i]< najmniejszy_dotychczas: 
            odp += 1
            najmniejszy_dotychczas = P[i]
    print(odp)
    
mniejsze_elementy()

Solution (Python):


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

cur_min = p[0]
ans = 1
for k, v in enumerate(p):
    if k == 0: continue
    if v <= cur_min:
        ans += 1
    cur_min = min(cur_min, v)

print(ans)

Solution (Python):


































INF = 10**18

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

minp = INF
res = 0
for p in P:
    if p < minp:
        minp = p
        res += 1
print(res)

Solution (Python):

class BIT:
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def get(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)

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

res = 0
bit = BIT(200010)
for i, p in enumerate(P):
    bit.add(p, 1)
    res += 1 if bit.sum(p) <= 1 else 0
    

print(res)

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

count = 1
min_num = p[0]


for i in p[1:]:
    if i < min_num:
        min_num = i
        count += 1
        

print(count)

Solution (Python):
def c_low_elements():
    import numpy as np
    N = int(input())
    P = np.array(input().split(), np.int32)
    return np.count_nonzero(P == np.minimum.accumulate(P))

print(c_low_elements())

Solution (Python):
def c_low_elements():
    import numpy as np
    N = int(input())
    P = np.array(input().split(), np.int32)
    Q = np.minimum.accumulate(P)
    return np.count_nonzero(P == Q)

print(c_low_elements())

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

cnt = 1
min_num = List[0]

for i in List[1:]:
    if i < min_num:
        min_num = i
        cnt += 1
print(cnt)

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

ans = 0
mn = INF
for a in A:
    if a < mn:
        mn = a
        ans += 1
print(ans)

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

class BIT:
    """ Binary Indexed Tree """

    def __init__(self, n):
        
        n += 1
        nv = 1
        while nv < n:
            nv *= 2
        self.size = nv
        self.tree = [0] * nv

    def sum(self, i):
        """ [0, i]を合計する """
        s = 0
        i += 1
        while i > 0:
            s += self.tree[i-1]
            i -= i & -i
        return s

    def add(self, i, x):
        """ 値の追加：添字i, 値x """
        i += 1
        while i <= self.size:
            self.tree[i-1] += x
            i += i & -i

    def get(self, l, r=None):
        """ 区間和の取得 [l, r) """
        
        if r is None: r = l + 1
        res = 0
        if r: res += self.sum(r-1)
        if l: res -= self.sum(l-1)
        return res

N = INT()
A = LIST()

bit = BIT(N)
ans = 0
for i in range(N):
    
    if bit.sum(A[i]) == 0:
        ans += 1
    bit.add(A[i], 1)
print(ans)

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

cnt = 1
min_num = nums[0]
for num in nums[1:]:
    if num < min_num:
        min_num = num
        cnt += 1
print(cnt)

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

mins = [P[0]]
for i in range(1, N):
    x = min(mins[-1], P[i])
    mins.append(x)



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

print(c)

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

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

mn = N+1
c = 0
for pi in P:
    if pi <= mn:
        c += 1
        mn = pi

print(c)

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

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

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

n_max = P[0]
cnt = 1

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

print(cnt)

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

Solution (Python):
n = int(input())
an = [int(i) for i in input().split()]
lowe, min_an_sub = 0, an[0]
an_sub = []
for i in range(0, n):
    an_sub.append(an[i])
    min_an_sub = min(min_an_sub, an[i])
    if an_sub[i] <= min_an_sub:
        lowe += 1
print(lowe)

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

smallest_so_far = float("inf")
cnt = 0

for the_num in P:
    if the_num < smallest_so_far :
        smallest_so_far = the_num
        cnt += 1
print(cnt)

Solution (Python):
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10**6
cnt=0
for i in range(N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

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

print(ans)

Solution (Python):
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=P[0]
cnt=1
for i in range(1,N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

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

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]:
      count+=1
      min=P[i]
print(count)

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

memo = n
for i in range(n):
    if memo > p[i]:
        m[i] = p[i]
        memo = p[i]
    else:
        m[i] = memo

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

print(count)

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

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

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

Solution (Python):
class SWAG():
    __slots__='unit','f','fold_r','fold_l','data_r','data_l'
    def __init__(self,unit,f,data):
        self.unit=unit
        self.f=f
        self.construct(data)
    def construct(self,data):
        self.fold_r=[self.unit]
        self.fold_l=[self.unit]
        self.data_r=[]
        self.data_l=[]
        sep=0--len(data)//2
        for t in data[sep:]:
            self.append(t)
        for t in data[sep-1::-1]:
            self.appendleft(t)
    def append(self,x):
        self.fold_r.append(self.f(self.fold_r[-1],x))
        self.data_r.append(x)
    def appendleft(self,x):
        self.fold_l.append(self.f(self.fold_l[-1],x))
        self.data_l.append(x)
    def pop(self):
        if not self.data_r:
            self.construct(self.data_l[::-1])
        if not self.data_r:
            return self.popleft()
        self.fold_r.pop()
        return self.data_r.pop()
    def popleft(self):
        if not self.data_l:
            self.construct(self.data_r)
        if not self.data_l:
            return False
        self.fold_l.pop()
        return self.data_l.pop()
    def fold_all(self):
        return self.f(self.fold_r[-1],self.fold_l[-1])
n,*p=map(int,open(0).read().split())
swag=SWAG(10**18,min,[])
a=0
for p in p:
    if p<swag.fold_all():
        a+=1
    swag.append(p)
print(a)

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

minp = P[0]
ans = 0

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

print(ans)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
min_ = 9999999999
ans = 0
for i in range(N):
    
    min_ = min(P[i], min_)

        
    if P[i] == min_:
        
        ans += 1
    
    
    

print(ans)

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

count=1
base=P[0]

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

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

m = p_list[0]
count = 1
for p in p_list:
  if p < m:
    count += 1
    m = p
print(count)

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

cnt = 0

maxmax = max(P) + 1

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

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

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

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

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


print(cnt)

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

ans = 0
mins = [10**6]
for i in P:
    v = min(mins[-1], i)
    mins.append(v)
mins.pop(0)

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

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

t = 0
j = 0

for i in range(N):
    while i >= j:
        if i == j:
            t += 1
            break
        elif P[i] >= P[j]:
            break
        else:
            j += 1
    

print(t)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

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

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

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


P_list = [int(i) for i in P_list]
length = int(N)
ans = 0 
M = []
mini =-1
for i in range(length):
    
    if P_list[i] <mini or mini <0:
        mini = P_list[i]
    if mini == P_list[i]:
        ans +=1


    
    
    
print(ans)

Solution (Python):
N = int(input())
P = [int(n) for n in input().split()]
c = 0
curr = 2*10**5+1
for p in P:
    if p < curr:
        curr = p
        c += 1
print(c)

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

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

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

print(count)

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

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

print(ans)

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


result=0

mm = 10**11

for pp in p:
    if pp <= mm:
        mm=pp
        result+=1

print(result)

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, P: "List[int]"):
    ans = [P[0]]
    
    for i in range(1, N):
        if P[i] < ans[-1]:
            ans.append(P[i])

    print(len(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 = input().split()
counter = 0
m = N
for p in P:
    if int(m) >= int(p):
        counter +=1
        m = p
print(counter)

Solution (Python):
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1001001
res=0
for i in range(n):
    if ans>a[i]:
        res+=1
        ans=min(ans,a[i])
print(res)

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

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


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


myans = 0
mymin = 9999999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)

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

m = next(P)
c = 1
for p in P:
    if p <= m:
        m = p
        c += 1
print(c)

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

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

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

counter=0
mj=N
for i in range(N):
  if mj>List[i]:
    mj=List[i]
  if List[i]==mj:
    counter+=1
print(counter)

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_right

sys.setrecursionlimit(10**7)
N = int(input())
P = list(map(int, input().split()))

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

print(cnt)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
ans=0
tmp=l[0]
for i in range(n):
    if tmp>=l[i]:
      tmp=l[i]
      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 m >= P[i]:
        ans += 1
        m = P[i]

print(ans)

Solution (Python):
def c_low_elements():
    N = int(input())
    P = [int(i) for i in input().split()]
    minimum = P[0]
    ans = 0
    for p in P:
        minimum = min(minimum, p)
        if minimum == p:
            ans += 1
    return ans

print(c_low_elements())

Solution (Python):
import math

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


best = pow(10,9)
count = 0

for i in range(len(data)):
    if data[i] < best:
        count += 1
        best = data[i]


print(count)

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

Solution (Python):
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      minNum = S[i]
      counter = counter + 1
    
  print(counter)

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

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

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

count = 0
tmpmin = float('inf')
for pi in p:
    if pi < tmpmin:
        count += 1
    tmpmin = min(tmpmin, pi)
print(count)

Solution (Python):
n=int(input())
lists=list(map(int,input().split()))
 
mn=n+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)

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

Solution (Python):
a = int(input())
array = list(map(int, input().strip().split()))
out = 0
min_num = array[0]
for i in array:
    min_num = min(min_num, i)
    out = out + 1 if i == min_num else out
print(out)

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

Solution (Python):
N = int(input())
P_list = [int(e) for e in input().split()]

min_P = P_list[0]
ans = 0

for i in P_list:
  
  
  if min_P >=i:
    
    ans += 1
    min_P = i
    
print(ans)

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]
pmin = max(P)
cnt = 0
for p in P:
  if p <= pmin:
    cnt += 1
    pmin = p
print(cnt)

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

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

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

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

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

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

m = []
a = p[0]
for j in range(n):
    if a >= p[j]:
        a = p[j]
        m.append(a)
    else:
        m.append(a)

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

Solution (Python):
n, *ps = map(int, open(0).read().split())
mp = ps[0]
cou = 1
for p in ps[1:]:
  if mp > p:
    cou += 1
    mp = p
print(cou)

Solution (Python):
import sys
from itertools import accumulate

read = sys.stdin.read

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

p = accumulate(P, min)
print(sum(i <= j for i, j in zip(P, p)))

Solution (Python):
n = int(input())
p = [int(i) for i in 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())
count = 0
min_num = N
for c in input().split():
    p = int(c)
    min_num = min(min_num, p)
    if min_num == p:
        count += 1
print(count)

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

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

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

value = 10 ** 9
ans = 0
for v in P:
    if v < value:
        ans += 1
        value = v
print(ans)

Solution (Python):

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

Solution (Python):

import sys


def solve(N: int, P: "List[int]"):

    result = 1
    min_num = P[0]
    for i in range(N):
        if P[i] < min_num:
            result += 1
            min_num = P[i]
        else:
            pass
    print(result)

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

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)

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

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

print(cnt)

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

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = p_list[i]

print(j)

Solution (Python):
n, *p = map( int, open(0).read().split())
 
cnt = 0
min_val = 1000000
for i in range( len( p )):
  if p[i] < min_val:
    cnt += 1
    min_val = p[i]

print( cnt )

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

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

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

Solution (Python):
_,p=open(0)
m=9e9
c=0
for p in map(int,p.split()):
 if p<m:c+=1;m=p
print(c)

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

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


print(ct)

Solution (Python):
def main():
    import sys
    N = int(input())
    input_2 = sys.stdin.readline
    P_list = list(map(int,input_2().split()))
    i_num = 0
    min_P = P_list[0]
    for p in P_list:
        if p <= min_P:
            min_P = p
            i_num += 1
    print(i_num)

if __name__ == "__main__":
    main()

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

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

Solution (Python):



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

cnt = 1
min = pn[0]
for i in range(1, n):
    if min > pn[i]:
        cnt += 1
        min = pn[i]

print(cnt)

Solution (Python):

import numpy as np
N = int(input())
P = np.array(list(map(int, input().split())))
min=P[0]
ans=1
for i in range(1,N):
    if min > P[i]:
        min = P[i]
        ans = ans +1
print(ans)

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

ans = 1
mi = p_list[0]

for i in range(1, N):
    if mi >= p_list[i]:
        ans += 1
        mi = p_list[i]
        
print(ans)

Solution (Python):
N = int(input())
P_lis = list(map(int, input().split()))
 
dummy = 2*10**5
answer = 0
 
for p in P_lis:
  if p <= dummy:
    answer += 1
    dummy = p
print(answer)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
max = 2*10**5
for a in P:
    if a <=max:
        
        cnt += 1
    max = min(max,a)
print(cnt)

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

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)

Solution (Python):
_,p=open(0)
m=9e9
c=0
for p in map(int,p.split()):c+=p<m;m=min(m,p)
print(c)

Solution (Python):

import sys


def solve(N: int, P: "List[int]"):
    count=0
    mi=P[0]
    for i in range(1,N+1):
        if i==1:
            count+=1
            
        else:
            if min(mi,P[i-1])==P[i-1]:
                count+=1
                mi=P[i-1]
                
    print(count)

    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())
li = list(map(int, input().split()))
ans = 0
min_ = li[0]
for i in range(len(li)):
  if li[i] <= min_:
    ans += 1
    min_ = li[i]
print(ans)

Solution (Python):
_,p=open(0)
m=10**18
c=0
for p in map(int,p.split()):
    c+=p<m
    m=min(m,p)
print(c)

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

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

i = 0
mini = n +1
for _ in lst:
    if mini > _:
        mini = _
        i += 1
print(i)

Solution (Python):

N = int(input())
P = map(int, input().split())
stack = []
size = 0
for p in P:
    if not stack or stack[-1] > p:
        stack.append(p)
        size += 1
print(size)

Solution (Python):
import bisect
import numpy as np

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


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()