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

min_num = 1001001001
ans = 0
for p in pl:
    if p <= min_num:
        ans += 1
        min_num = p

print(ans)

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

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

print(ans)

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()))
ans = 0
m = 200002
for p in P:
    if p <= m:
        m = p
        ans += 1
print(ans)

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

min=p[0]
cnt=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()))
ans = 1
p_min = p[0]

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

print(ans)

Solution (Python):
N = int(input())
P_ls = map(int, input().split(' '))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

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

cnt = 1
min_n = S[0]
for n in S[1:]:
  
  if n <= min_n:
    min_n = n
    cnt += 1
    
print(cnt)

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

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

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

ans = 0
m = p[0]

for i in p:
	if m >= i:
		ans += 1
		m = i

print(ans)

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

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

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

print(cnt)

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

Solution (Python):
N = int(input())
P_ls = list(map(int, input().split(' ')))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

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

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

print(count)

Solution (Python):
N = int(input())
P_ls = map(int, input().split(' '))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

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

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

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

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

Solution (Python):


def main():
    N = int(input())
    tmp = 200001
    ans = 0
    A = list(map(int, input().split()))

    for a in A:
        if a < tmp:
            ans += 1
            tmp = a

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys

n = int(input())
p = list(map(int,input().split()))
min = sys.maxsize
cnt = 0

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

print(cnt)

Solution (Python):
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

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

main()

Solution (Python):
n = int(input())
L = list(map(int,input().split()))
mini = L[0]
ans = 0

for l in L:
  if mini >= l:
    ans += 1
    mini = l
print(ans)

Solution (Python):
N=int(input())
from collections import deque
P=deque(list(map(int, input().split())))

min_v=P.popleft()
cnt=1
while P:
	temp=P.popleft()
	if temp<=min_v:
		cnt+=1
		min_v=temp

print(cnt)

Solution (Python):
N = int(input())
P_ls = map(int, input().split(' '))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

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

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

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

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

print(ans)

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

for i in range(1,n):
  if m >=x[i]:
    count+=1
    m = x[i]
  
print(count)

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

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

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

Solution (Python):

def main():
    _ = int(input())
    P = [int(x) for x in input().split()]

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


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
P_ls = map(int, input().split(' '))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
min = 10 ** 100
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()))
m=N
ans=0
for i in range(N):
    if m>=P[i]:
        ans+=1
    m=min(m,P[i])
print(ans)

Solution (Python):
N = int(input())
P_ls = list(map(int, input().split(' ')))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

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

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

Solution (Python):
N = int(input())
P_ls = list(map(int, input().split(' ')))
min_val = 10 ** 6
rst = 0
for i in P_ls:
    if i <= min_val:
        rst += 1
        min_val = i
print(rst)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
T = [P[0]]+[10**10]*(N-1)
ans = 0

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

print(ans)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
T = [P[0]]+[10**10]*(N-1)
ans = 0

for i in range(N):
    T[i] = min(T[i-1],P[i])

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

print(ans)

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    numbers=[]
    n = int(input())
    numbers=list(map(int,input().split()))
    small=0
    dp=[]

    for idx,data in enumerate(numbers):
        if idx == 0:
            small=data
            dp.append(data)
        elif data < small:
            small=data
            dp.append(data)
        else:
            continue
    print(len(dp))

if __name__=="__main__":
    main()

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

print(ans)

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

Solution (Python):
N = int(input())
P_ls = list(map(int, input().split(' ')))
rst, min_val = 0, 10 ** 6
for i in P_ls:
    if min_val >= i:
        rst += 1
        min_val = i
print(rst)

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
ans=0
mini=10**6
for p in P:
    if p<=mini:
        mini=p
        ans+=1
print(ans)

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

cnt = 0
mini = float('inf')

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

print(cnt)

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

Solution (Python):

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

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    P=LI()
    m=P[0]
    cnt=1
    for i in range(1,N):
        if P[i]<m:
            cnt+=1
            m=P[i]
            
    print(cnt)

main()

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

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

Solution (Python):

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

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

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

S = sorted(P, reverse = True)
cn = 0
L = []



for i in range(N):
    if i == 0:
        cn = cn + 1
        L.append(P[i])

    else:
        if P[i] > L[0]:
            continue
                
        else:
            cn = cn + 1
            L.append(P[i])
            L.pop(0)


print(cn)

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np
N = int(input())
P = [int(c) for c in input().split()]

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

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

ans = 0
check = 10**9 + 7

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

print(ans)

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

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

print(ans)

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

ans=0
tempmin=P[0]

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

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

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



 

m = [0]*(N)
m[0] = p[0]
for i in range(1, N):
  m[i] = min(m[i-1], p[i])


ans = 1
for i in range(1, N):
  if m[i-1] >= p[i]: ans += 1

print(ans)

Solution (Python):
N = int(input())
P_ls = list(map(int, input().split(' ')))
rst, min_val = 0, 10 ** 6
for i in P_ls:
    if min_val >= i:
        rst += 1
        min_val = i
print(rst)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]
cnt = 0
min_ = float('inf')
for pi in p:
  if pi < min_:
    cnt += 1
    min_ = pi
print(cnt)

Solution (Python):

import sys
from itertools import chain







def solve(N: int, P: "List[int]"):
    min_p = P[0]
    count = 0
    for p in P:
        if p <= min_p:
            min_p = p
            count += 1

    return count


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    N = int(next(tokens))  
    P = [int(next(tokens)) for _ in range(N)]  
    answer = solve(N, P)
    print(answer)


if __name__ == "__main__":
    main()

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

mini = 10**9
ans =0 

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

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

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

min_p = 2 * 10**5 + 1
ans = list()
for i, v in enumerate(p, 1):
  if min_p > v:
    min_p = v
    ans.append(v)

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

Solution (Python):

"""
Created on Tue Sep  8 02:46:31 2020

@author: liang
"""

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

low = P[0]
count = 0

for p in P:
    if low >= p:
        low = p
        count += 1
print(count)

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

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

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

print(ans)

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

Solution (Python):

def main():
    n = int(input())
    p = list(map(int, input().split(" ")))
    ans = 0
    min = 2e5+1
    for i in range(n):
        if min > p[i]:
            min = p[i]
        if p[i] <= min:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

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

Solution (Python):
N = int(input())
nums = list(map(int, input().split()))
before_min = 10**6
answer = 0
for num in nums:
  if num <= before_min:
    answer += 1
    before_min = min(before_min, num)
print(answer)

Solution (Python):
n=int(input())
P=list(map(int,input().split()))
ans=0
minp=n+1
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()))
min = A[0]
count = 1
for i in range(1, N):
  if A[i] <= min:
    count += 1
    min = A[i]
  else:
    continue
print(count)

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

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

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

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
count=0
min=2*10**5
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()))

maxp = 999999
cnt=0

for x in p:
    if maxp >= x:
        cnt += 1
        maxp = x

print(cnt)

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

m = N
ans = 0

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

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

num = float("inf")
ans = 0

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

Solution (Python):
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
p = li()

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

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

min_num = N+1
ans = 0

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

Solution (Python):
n = int(input())
P = list(map(int, input().split()))
P_min = P[0]
cnt = 1

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

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

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

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






m = [0]*(N)
m[0] = p[0]
for i in range(N-1):
  m[i+1] = min(m[i], p[i+1])


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

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

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


m = [0]*(N)
m[0] = p[0]
for i in range(N-1):
  m[i+1] = min(m[i], p[i+1])

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

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

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

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
n = float("INF")
count = 0
for i in P:
  if n >= i:
    n = i
    count += 1
print(count)

Solution (Python):
N = int(input())
l = input().split()
p = []
for i in range(N):
    p.append((int(l[i]),i))

p.sort()

s = N
ans = 0
for i in range(N):
    (a,b) = p[i]
    if b < s:
        ans += 1
        s = b
print(ans)

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

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

Solution (Python):


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

Solution (Python):

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    P = list(map(int, readline().split()))
    cur = N + 1
    ans = 0
    for x in P:
        if cur > x:
            ans += 1
            cur = x

    print(ans)

if __name__ == '__main__':
    main()

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

num = P[0]
count = 1

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

print(count)

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

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

MIN = 20000000
cnt = 0
for n in range(len(P)):
    if MIN > P[n]:
        cnt += 1
        MIN = P[n]

print(cnt)

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

a=n
c=0

for i in p:
    if i<=a:
        a=i
        c+=1
print(c)

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

min_val = n + 1
count = 0
for x in p:
    if x < min_val:
        min_val = x
        count += 1
print(count)

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):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    n = int(input())
    a = np.array(read().split(), np.int32)
    mina = np.minimum.accumulate(a)
    r = np.count_nonzero(mina >= a)
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    n, *a = map(int, read().split())

    p = np.array(a)
    minp = np.minimum.accumulate(p)
    r = np.count_nonzero(minp >= p)
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    n, *a = map(int, read().split())

    p = np.array(a)
    minp = np.minimum.accumulate(p)
    r = 0
    for i1, ae in enumerate(a):
        r += minp[i1] >= ae

    print(r)

if __name__ == '__main__':
    main()

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

cnt=0
num=max(l)

for i in l:
  num=min(num,i)
  if num==i:
    cnt+=1
    
print(cnt)

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n, *a = map(int, read().split())

    r = 0
    minp = a[0]
    for i1 in range(n):
        if minp >= a[i1]:
            r += 1
            minp = a[i1]

    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
cc = map(int,input().split())
min_num = N
count = 0
for i in cc:
  if i <= min_num:
    min_num = i
    count += 1
print(count)

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

print(y)

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

Solution (Python):
def main():
    n = int(input())
    p_lst = list(map(int, input().split()))

    min_val = n + 1
    ans = 0

    for i in range(n):
        if min_val >= p_lst[i]:
            min_val = p_lst[i]
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    p_lst = list(map(int, input().split()))

    min_val = n + 1
    ans = 0

    for i in range(n):
        if min_val > p_lst[i]:
            min_val = p_lst[i]
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

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

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

print(cnt)

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

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

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

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

pj = P[0]
cnt = 1
for pi in P[1:]:
    if pi < pj:
        cnt += 1
        pj = pi
print(cnt)

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

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

Solution (Python):
import math

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

min_ = math.inf
ans = 0
for p in P:
    ans += p <= min_
    min_ = min(min_, p)
print(ans)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
mi = L[0]
co = 1
for i in range(1, N):
  mi = min(L[i], mi)
  if L[i] == 1:
    co += 1
    break
  elif mi == L[i]:
    co += 1
print(co)

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

min = 1e8
n = 0

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

print(n)

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

Solution (Python):
N=int(input())
P=list(map(int,input().split()))
x=N+1
cnt=0

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

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

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

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

def main():
    N = int(input())
    P = list(map(int, input().split()))
    min_so_far = sys.maxsize
    ans = 0
    for p in P:
        if p <= min_so_far:
            ans += 1
            min_so_far = p
    print(ans)


if __name__ == '__main__':
    main()

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

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

print(ans)

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

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

print(ans)

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

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


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


def solve():
    N = int(input())
    P = list(map(int, input().split()))
    ans = 0
    mini = INF
    for i in range(N):
        ans += mini >= P[i]
        mini = min(mini, P[i])
    print(ans)


def main():
    solve()


if __name__ == '__main__':
    main()

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

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

c_min = P[0]
cnt = 1

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

print(cnt)

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

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

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

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

min_num = float('inf')
ans = 0
for i in P:
  if i < min_num:
    ans+=1
    min_num = i
print(ans)

Solution (Python):








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

ans = 1
minVal = p[0]

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

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

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

print(cnt)