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

Solution (Python):
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]


n = ni()
p = na()

c = 1
f = p[0]

for pi in p[1:]:
    if f >= pi:
        c += 1
        f = pi
print(c)

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

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


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

print(count)

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

min_val = float("inf")

count = 0

for p in P:
    if p < min_val:
        count += 1
        min_val = p
print(count)

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

M = [P[0]]
tmp_min = P[0]
for i in range(1, N):
    if P[i] < tmp_min:
        tmp_min = P[i]
    M.append(tmp_min)

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

print(ans)

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

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

print(ans)

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

ans = 0

mini = float('inf')

for p in P:
    mini = min(mini, p)
    if mini >= p:
        ans += 1
print(ans)

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

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

Solution (Python):
n = int(input())
P = [int(x) for x in input().split()]
mins = [P[0]]
for i in range(1,n):
    mins.append(min(mins[-1], P[i]))

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

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

ans = 1

pa = p[0]

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

print(ans)

Solution (Python):

import re
import math


mod=int(10**9+7)


N=int(input())
P=list(map(int,input().split()))
min_=mod
ans=0
for a in P:
    if min_>=a:
        min_=a
        ans+=1
print(ans)

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

Solution (Python):
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0): 
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def round_up(a): 
    return int(a + 0.9)

def gcd(a,b): 
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

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

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

def is_prime(a): 
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): 
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): 
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    n = int(input())
    p = [x for x in map(int,input().split())]
    num = int(1e9)
    ans = 0
    for i in range(n):
        if p[i] <= num:
            num = p[i]
            ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()

Solution (Python):
words = lambda t : list(map(t, input().split()))
n = int(input())
xs = words(int)
minx = n+1
ans = 0
for i in range(n):
    if xs[i] < minx:
        minx = xs[i]
        ans += 1
print(ans)

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

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

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


i = 0
min_val = float("inf")
res = 0
while i < N:
    if A[i] <= min_val:
        res += 1
    min_val = min(min_val, A[i])
    i += 1

print(res)

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

mn=10**9
count=0
for i,num in enumerate(ls):
    if num<=mn:
        count+=1
        mn=num
print(count)

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

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

Solution (Python):
N = int(input())
n = input()    
m = n.split()
p = [int(i) for i in m]
z = N + 1
a = 0
for i in p:
    if i < z:
        a = a + 1
        z = i
    else:
        pass
print(a)

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
ppp = get_nums_l()

ans = 0
min_ = 999999999999
max_ = -99999999999
for i,p in enumerate(ppp):

    if p < min_:
        min_ = p
        ans += 1

print(ans)

Solution (Python):
n = int(input())
p_lis = list(map(int, input().split()))
min_p = n + 1
cnt = 0
for idx, p in enumerate(p_lis):

    if min_p > p:
        cnt += 1
    min_p = min(min_p, p)
print(cnt)

Solution (Python):


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

ans=0
mi=10**9
for i in range(N):
    if mi>P[i]:
        mi=P[i]
        ans+=1
        

print(ans)

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


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

    lowest = Ps[0]
    total = 0

    for p in Ps:
        if p <= lowest:
            total += 1
            lowest = p

    print(total)


if __name__ == '__main__':
    main()

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

ans = 0
cur = None
for i in range(N):
    if cur is None or cur >= P[i]:
        ans += 1
        cur = P[i]

print(ans)

Solution (Python):
def main():
    _=int(input())
    p=list(map(int,input().split()))
    x=10**9
    ans=0
    for i in p:
        if i <= x:
            ans += 1
            x=i
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
import math
from collections import deque

n=int(input())
ans=0
m=99999999
s=input().split(" ")
for i in range(n):
    x=int(s[i])
    if x<m:
        ans+=1
    m=min(m,x)
print(ans)

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

Solution (Python):
n = int(input())
num = [ int(v) for v in input().split() ]
ans = 0
minn = 10**9
for i in range(n):
    if minn > num[i]:
        minn = num[i]
        ans += 1
print(ans)

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

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

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

min_val = 10**9+7
count = 0
for i in range(n):
    if min_val >= p_list[i]:
        count = count + 1
        min_val = p_list[i]
print(count)

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

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

print(cnt)

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

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

mini =10**9
cnt = 0
for i in range(n):
    if Ps[i] <= mini:
        mini = Ps[i]
        cnt += 1

print(cnt)

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

Solution (Python):
import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


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


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

min_p = 2 * 10**5 + 1
cnt = 0
for x in p:
  if min_p >= x:
    cnt += 1
    dprint(x)
  min_p = min(min_p, x)

print(cnt)

Solution (Python):
N = int(input())
P = [int(p) for p in input().split()]
cur = float('inf')
res = 0
for p in P:
    if p <= cur:
        res += 1
    cur = min(cur, p)
print(res)

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

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

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

Solution (Python):
import sys
import math
from collections import deque
input = sys.stdin.readline
N = int(input())
P = list(map(int,input().split()))
check = P[0]
ans = 0
for i in P:
    if i <= check:
        ans += 1
        check = min(check, i)

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
m = 10 ** 6
ans = 0
for pi in p:
    m = min(pi, m)
    if pi <= m:
        ans += 1
print(ans)

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

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
B = [0]*N
B[0] = A[0]
for i in range(1,N):
    B[i] = min(A[i], B[i-1])

ans = 1
for i in range(1,N):
    if B[i-1]>=A[i]:
        ans += 1
print(ans)

Solution (Python):
import queue
import math
import copy
"""
N = int(input())



A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""

N = int(input())
A = [int(i) for i in input().split()]
mn = 10000000
ans = 0
for a in A:
	if a <= mn:
		ans += 1
	mn = min(mn,a)
print(ans)

Solution (Python):

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

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

print(ans)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
P = [int(i) for i in input().split()]
k = N+10
count = 0
for i in range(N) :
    if k >= P[i] :
        k = P[i]
        count +=1
print(count)

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

c = dat[0]
res = 0
for i in range(n):
    if dat[i] <= c:
        res += 1
    c = min(c, dat[i])
print(res)

Solution (Python):
import sys
input = sys.stdin.readline
n=int(input())
P=list(map(int,input().split()))
cnt=1
mn=P[0]
for i in range(1,n):
    if mn>=P[i]:
        cnt+=1
        mn=P[i]
print(cnt)

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

count = 1
cur_min = P_list[0]
for i in range(1, N):
	cur = P_list[i]
	if cur_min >= cur:
		count += 1
		cur_min = cur
print(count)

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

ans = 0
min_p = float('inf')
for p in pl:
    if p < min_p:
        ans += 1
        min_p = p

print(ans)

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

Min = 1000000
Sum = 0

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

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

ans=1
M=p[0]
for i in p[1:]:
    M=min(M,i)
    if M==i:
        ans+=1
print(ans)

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


if __name__ == '__main__':
    main()

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

print(ans)

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

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

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

print(ans)

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

now = p[0]
ans = 1

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

print(ans)

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

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

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
P = lr()
answer = 1
cur = P[0] 
for i in range(1, N):
    x = P[i]
    if cur >= P[i]:
        answer += 1
        cur = P[i]

print(answer)

Solution (Python):
INF = int(1e9)

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

Solution (Python):
import sys
from itertools import accumulate

read = sys.stdin.read

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

p = list(accumulate(P, min))

answer = 0
for i, j in zip(P, p):
    if i <= j:
        answer += 1

print(answer)

Solution (Python):
import sys

n, *p = map(int, sys.stdin.read().split())

def main():
    mi = float('inf')
    res = 0
    for i in range(n):
        if p[i] <= mi:
            res += 1
            mi = p[i]
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

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

mini=float("inf")
ans=0
for i in range(n):
    if P[i]<=mini:
        ans+=1
        mini=P[i]

print(ans)

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

Solution (Python):
N = int(input())
arr = list(map(int, input().split()))
ans = 0
mn = float('inf')
for i in arr:
    if mn > i:
        ans += 1
    mn = min(i,mn)
print(ans)

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect
import heapq


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():
    
    
    
    
    
    
    
    N = get_input(int)
    P = get_inputs(int)

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

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

        P_min = min(P_min, P[i])
    
    print(ans)

    return


if __name__ == '__main__':
    main()

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

Solution (Python):
n=int(input())
p=[int(i) for i in input().split()]
mi=10000000
x=[0]*n
for i in range(n):
    if mi>p[i]:
        x[i]=1
        mi=p[i]

print(sum(x))

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:
        if minimum >= p:
            ans += 1
            minimum = p
    return ans

print(c_low_elements())

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline

n = int(input())
a = [int(item) for item in input().split()]

minima = a[0]
ans = 0
for item in a:
    if item <= minima:
        ans += 1
        minima = item
print(ans)

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

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

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

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

mini = pn[0]
cnt = 1
for p in pn[1:]:
  if p <= mini:
    cnt += 1
  mini = min(mini, p)
print(cnt)

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

m = 10 ** 6
cnt = 0
for i in range(N):
    if Ps[i] < m:
        cnt += 1
        m = Ps[i]
print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok


def main():
    N=ii()
    m = INF
    ans = 0
    for val in mis():
        if m >= val:
            ans += 1
            m = val
    print(ans)

main()

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

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

cnt = 1
min_val = ps[0]

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

print(cnt)

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

m = n
c = 0
for i in p:
    if m >= i:
        c += 1
        m = i
print(c)

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

MIN=10**9
ans=0
for p in P:
    MIN=min(MIN,p)
    if p <= MIN:
        ans+=1
print(ans)

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

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

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
min_v = float("inf")
ans = 0
for p in P:
    min_v = min(min_v, p)
    if p == min_v:
        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 p[i] <= tmp:
    ans += 1
    tmp = p[i]
print(ans)

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

ans = 0
tmp_min = P[0]

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

print(ans)

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

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

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

ans = 0
minP = N+1

for p in P:
    if (p < minP):
        ans += 1
        minP = p
print(ans)

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

count = 0

mina = 10**8

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

print(count)

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

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

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

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

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

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

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]

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

m = l[0]
cnt = 0
for i in range(N):
    k = l[i]
    if k<=m:
        m = k
        cnt += 1
print(cnt)

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



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

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
m=10**9

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

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

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

a, ans = float("inf"), 0
for x in p:
    if a >= x:
        ans += 1
        a = min(a, x)

print(ans)

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

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

print(count)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
p=list(map(int,input().split()))
mi=float('inf')
ans=0
for i in range(n):
    if p[i]<=mi:
        ans+=1
        mi=p[i]
print(ans)

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

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

print(ans)

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

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())
arr = list(map(int, input().split()))
ans = 0
tmp = 10 ** 10
for a in arr:
    if tmp >= a:
        ans += 1
        tmp = min(tmp, a)
print(ans)

Solution (Python):






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

m = float('inf')
ans = 0
for x in p:
    if x < m:
        ans += 1
        m = x

print(ans)

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

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

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

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

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

pMin = N+1
ans = 0
for p in Ps:
    if p <= pMin:
        ans += 1
        pMin = p
print(ans)

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

cnt = 0
a = P[0]
for x in P:
    if x <= a:
        cnt += 1
        a = x

print(cnt)

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

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

ans = 0
m = N + 1

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

print(ans)

Solution (Python):

import sys
input = sys.stdin.buffer.readline


from collections import defaultdict


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


def main():
	N = int(input())
	P = getlist()
	S = [0] * N
	S[0] = P[0]
	for i in range(1, N):
		S[i] = min(S[i - 1], P[i])
	
	ans = 0
	for i in range(N):
		if S[i] >= P[i]:
			ans += 1
	print(ans)
	
if __name__ == '__main__':
	main()

Solution (Python):

import sys


def solve(N: int, P: "List[int]"):
    m = P[0]
    ans = 1
    for p in P:
        if p < m:
            ans += 1
            m = p
    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=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()))
min = N+1
c = 0
for i in range(N):
    p = P[i]
    if min >= p:
        c += 1
        min = p
print(c)

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

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

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

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

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

lowest = n
ans = 0

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

print(ans)

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split()))
    min_P = float('inf')
    cnt = 0
    for i in range(N):
        if P[i] <= min_P:
            cnt += 1
        min_P = min(min_P, P[i])

    print(cnt)


if __name__ == "__main__":
    main()

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

print(cnt)

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

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

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

ans = 0
mini = 10 ** 9

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

print(ans)

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_:
        min_ = p[i]
        cnt += 1

print(cnt)

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

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split()))
    m = N + 1
    r = 0
    for i in P:
        if i < m:
            r += 1
            m = i
    print(r)
main()

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

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

Solution (Python):
import math
import sys

N  = input()
A  = list(map(int,input().split()))
min = 10 ** 6
ans = 0 
for a in A:
    if min > a:
        min = a
        ans = ans +1
print(ans)

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

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

res = 0
minn = P[0]
for i, p in enumerate(P):
    if minn >= p:
        res += 1
    minn = min(minn, p)

print(res)

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

ruiseki = [10**9] * (n + 1)
for i in range(n):
    ruiseki[i + 1] = min(ruiseki[i], p[i])

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

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

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

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

ans = 1
minP = P[0]
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()))

now_min = 10**9
ans = 0
for p in P:
    if p <= now_min:
        ans += 1
        now_min = p

print(ans)

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

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

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