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

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

print(count)

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

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

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

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

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

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

print(ans)

Solution (Python):
def main():
    N = int(input())
    P = [int(p) for p in input().split()]
    mi = N + 1
    cnt = 0
    for i in range(N):
        if P[i] < mi:
            mi = P[i]
            cnt += 1
    print(cnt)
if __name__ == "__main__":
    main()

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

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

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

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

cnt = 1
min_num = p_list[0]

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

print(cnt)

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

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

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

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

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

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

print(ans)

Solution (Python):

n = int(input())
seq = list(map(int,input().split()))
c = []
cnt = 0
for i in range(n):
    if i == 0:
        cnt+=1
        c.append(seq[0])
    else:
        if c[-1] >= seq[i]:
            cnt += 1
            c.append(seq[i])
        
print(cnt)

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

Solution (Python):
stdin = open(0).read().split('\n')
N = int(stdin[0])
P = list(map(int,stdin[1].split()))
ans = 0
min = P[0]
for i in range(N):
    if min >= P[i]:
        ans +=1
        min = P[i]
print(ans)

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

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

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

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

Solution (Python):

n=int(input())
a=list(map(int,input().split()))
st=[]
ans=0
for i in range(n):
    if i==0:
        st.append(a[i])
        ans+=1
    else:
        if st[-1]>=a[i]:
            ans+=1
            st.append(a[i])
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
P = rl()

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

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
a=1
m=A[0]
for i in range(1,N):
  if A[i]==1:
    a+=1
    break
  if m>=A[i]:
    m=A[i]
    a+=1
  else:
    continue
print(a)

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

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

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

Solution (Python):
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)


args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def main():
    """エントリーポイント"""
    N = input(int)
    P = input([int, N])
    min_, count = P[0], 1
    for p in P[1:]:
        if p < min_:
            count += 1
            min_ = p
    print(count)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

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

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

ans = 0;
min_ = 2 * (10 ** 5);

for i in range(n):
  min_ = min(A[i], min_);
  if min_ == A[i]:
    ans += 1;
  else:
    pass;
print(ans);

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

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

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

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

print(ans)

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

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

min_num=p_inputs[0]
ans=0

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

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

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

print(answer)

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

count = 1
min = p[0]

for i in range(1, N):
    if p[i] < min:
        count +=1
        min = p[i]
    

print(count)

Solution (Python):
from collections import defaultdict

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

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

Solution (Python):
import sys

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

def main():
    m = float('inf')
    cnt = 0
    for x in p:
        if x > m: continue
        cnt += 1
        m = x
    print(cnt)

if __name__ ==  '__main__':
    main()

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]
count = 0
minut = 3*10**5
for i in range(len(P)):
  m = P[i]
  if m < minut:
    minut = m
  if m == minut:
    count += 1
print(count)

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

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

Solution (Python):
def number(l):
  count=0
  mini=l[0]
  for i in range(n):
    if l[i]<=mini:
      mini=l[i]
      
      count+=1
  return count

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

Solution (Python):
def number(m,l):
  count=0
  mini=l[0]
  for i in range(m):
    if l[i]<=mini:
      mini=l[i]
      
      count+=1
  return count

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

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

count = 0
mn = float('inf')
for i in range(N):
    if mn >= arr[i]:
        count += 1
        mn =min(mn,arr[i])

print(count)

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

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


mn=pl[0]

mnl=[]
count=1
for i in range(n):
    mn=min(mn,pl[i])
    mnl.append(mn)

for i in range(1,n):
    if pl[i]<=mnl[i-1]:
        count+=1
print(count)

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

L=[P[0]]
if N>1:
  maxvalue=[L.append(min(L[-1],P[i])) for i in range(1,N)]
print(sum([1 if L[i]==P[i] else 0 for i in range(N)]))

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




for i in List:
    x = 0
    if i <= min:
        count += 1
        min = 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 p[i]<=min:
        ans+=1
        min=p[i]
print(ans)

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

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

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

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

cnt = 0
mn = 200001
for a in P:
    if a < mn:
        cnt += 1
        mn = a
print(cnt)

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

min=1000000000
ans=0

for i in P:
    if i<=min:
        ans+=1
        min=i
print(ans)

Solution (Python):



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

mini = N+1
idx = []
for i in range(N):
  if mini>P[i]:
    mini = P[i]
    idx += [i+1]
print(len(idx))

Solution (Python):
count = 0

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

min = 10**7
for i in range(n):
    if p[i] < min:
        count += 1
        min = p[i]

print(count)

Solution (Python):
n = int(input())
P = list(map(int, input().split()))
mi = float('inf')
cnt = 0
for p in P:
    if p <= mi:
        mi = p
        cnt += 1
print(cnt)

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

ans=0
flag=10**7
for i in range(n):
    if p[i]<flag:
        ans+=1
        flag=p[i]
print(ans)

Solution (Python):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()

P = FLI()

min = 10**9
ans = 0
for i in range(n):
    if P[i] < min:
        ans += 1
        min = P[i]
        
print(ans)

Solution (Python):
def main():
  n = int(input())
  l = list(map(int, input().split()))
  lowest = 2 * (10**5)
  ans = 0
  for i in l:
    if i <= lowest:
      lowest = i
      ans += 1
  print(ans)
  
if __name__ == "__main__":
  main()

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


if __name__ == '__main__':
    q3()

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

minv = 10 ** 9
ans = 0

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

print(ans)

Solution (Python):
n = int(input())
pn = list(map(int, input().split()))
min_num = 10**6
counter = 0

for i in range(n):
   if pn[i] <= min_num:
      min_num = pn[i]
      counter += 1
      
print(counter)

Solution (Python):
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''
N = int(input())
arr = list(map(int,input().split()))
add = 1000000
cnt = 0
for i in range(N):
	if add>arr[i]:
		cnt+=1
		add = arr[i]
print(cnt)

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

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

Solution (Python):


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

b = n + 1 
ans = 0
for i in range(n):  
    if P[i] <= b:
        b = P[i]
        ans += 1
    else:
        pass
print(ans)

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

current_min = float('inf')
cnt = 0
for i in range(N):
    if P[i] <= current_min:
        cnt += 1
        current_min = P[i]

print(cnt)

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

num = p[0]
ans = 1


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



print(ans)

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

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

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

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    p = list(map(int, input().split()))
    ans = 1

    if len(p) <= 1:
        print(ans)
        return
    
    min_so_far = p[0]

    for i in range(1, len(p)):
        if p[i] > min_so_far:
            continue
        else:
            min_so_far = p[i]
            ans += 1
    
    print(ans)
    



if __name__ == '__main__':
    main()

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

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

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

ans = 0
m = P[0]

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

print(ans)

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

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

M = N+1
ans = 0

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

print(ans)

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

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

Solution (Python):
def myAnswer(N:int,P:list) -> int:
   total = 0
   MIN = 10**10
   for i in range(N):
      MIN = min(MIN,P[i])
      if(MIN>= P[i]):
         total+=1
   return total

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   P = list(map(int,input().split()))
   print(myAnswer(N,P[:]))

if __name__ == '__main__':
   main()

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

Solution (Python):
num = input()
a = [int(i) for i in input().split(" ")]
mi = a[0]
ans = 0

for num,i in enumerate(a):
    if i <= mi: ans += 1
    if i < mi: mi = i

print(ans)

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

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

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

l = 0
a = P[0]
for p in P:
    if p <= a:
        a = p
        l += 1
        continue
print(l)

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

l = []
a = P[0]
for i in range(N):
    if P[i] <= a:
        a = P[i]
        continue
    else:
        l.append(i)
print(N - len(l))

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

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

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

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

print(ans)

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

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

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

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

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

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

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

Solution (Python):
def main():
    n = int(input())
    min_num = 10 ** 9
    ans = 0
    for p in map(int, input().split()):
        if p < min_num:
            ans += 1
            min_num = p
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):

import sys


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

    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):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    P=[int(_) for _ in input().split()]
    count=0
    min_p=10**6
    for i in range(n):
        if min_p>P[i]:
            count+=1
            min_p=P[i]
    print(count)

if __name__=='__main__':
    main()

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

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

res = 10e9
ans = 0
for p in P:
    if (res > p):
        res = p
        ans += 1

print(ans)

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

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

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

p_min = Pn[0]
count = 0
for i in Pn:
    if i <=p_min:
        count += 1
    p_min = min(p_min, i)
print(count)

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

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

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

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

ans = 1
cmin = P[0]

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

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

Solution (Python):


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

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

if __name__ == "__main__":
    main()

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

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

print(count)

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

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

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

Solution (Python):
import math

n = int(input())
pL = list(map(int, input().split(" ")))

mi = pL[0]
cnt = 1

for i in range(1, len(pL)):
    if pL[i] < mi:
        cnt += 1
        mi = pL[i]

print(cnt)

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

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

minval = p[0]
count = 0
for i in p:
    if(i <= minval):
        count = count + 1
    if(minval > i):
        minval = i

print(count)

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

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

Solution (Python):

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

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

Solution (Python):
n = int(input())
P = list(map(int,input().split(' ')))
count = 1
i = 1
Pmin = P[0]
while i < n:
    if Pmin == 2:
        count += 1
        break
    elif P[i] < Pmin:
        count += 1
        Pmin = P[i]
    i += 1
print(count)

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

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

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

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

n = int(readline())
p = list(map(int, readline().split()))
cnt = 0
min_p = float('inf')
for i in range(n):
    min_p = min(min_p, p[i])
    if min_p == p[i]:
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())
p_list = [int(s) for s in input().split()]

p_max = max(p_list) + 1
p_min = p_max

count = 0
for p in p_list:
    if p <= p_min:
        count += 1
        p_min = p
print(count)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
ans = 0
minp = 200000


for i in p:
    if i <= minp:
        ans += 1
        minp = i

print(ans)

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


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

print(ans)

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

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

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

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

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

Solution (Python):

def input1():
	return int(input())


def input2():
	return map(int,input().split())


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


N=input1()
p=input_array()
count=0
min_int=0
for i in range(N):
	num=p[i]
	if i==0:
		min_int=num
		count+=1
	elif num<=min_int:
		min_int=num
		count+=1
		
print(count)

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

cnt = 0
tmp_min = max(lst)
for i in range(len(lst)):
    num = lst[i]
    if num <= tmp_min:
        cnt += 1
        tmp_min = num

print(cnt)

Solution (Python):
import os

def main():
	count = int(input())
	num_p = list(map(int, input().split()))
	ans_list = []
	ans_list.append(num_p[0])
	min_num = ans_list[0]
	for i in range(1,len(num_p)):
		if min_num > num_p[i]:
			ans_list.append(num_p[i])
			min_num = num_p[i]
		else:
			pass
	print(len(ans_list))


if __name__ == '__main__':
	main()

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

    ans = 1
    min_val = P.pop(0)
    for p in P:
        if p <= min_val:
            ans += 1
            min_val = p

    print(ans)

if __name__ == '__main__':
    main()

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

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

print(count)

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

Solution (Python):
from collections import deque

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

mx = P[0]
mn = mx
count = 0

ans = deque(list(filter(lambda x:mx >= x,P)))

ln = len(ans)

for a in range(ln):
    num = ans.popleft()
    if mx >= num:
        mx = num
        count += 1
    else:
        continue

print(count)

Solution (Python):
from collections import deque

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

mx = P[0]
mn = mx
count = 0

cut = deque(list(filter(lambda x:mx >= x,P)))
ans = deque()

ln = len(cut)

for a in range(ln):
    num = cut.popleft()
    if mx >= num:
        mx = num
        count += 1
    else:
        continue

print(count)

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

mi_p=1000000
count = 0
for p in p_list:
    if p < mi_p:
        count = count + 1
        mi_p = p

print(count)

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

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

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

count = 0
min = 200005

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

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

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

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

mv_left = [float("inf")] * n
for j in range(n):
    if j == 0:
        mv_left[j] = p[j]
    else:
        mv_left[j] = min(p[j], mv_left[j - 1])




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

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]
cnt=1
tmp=P[0]
for i in range(1, N):
    tmp = min(tmp, P[i-1])
    if tmp >= P[i]:
        cnt+=1

        
print(cnt)

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

s = 10**18
ans = 0

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