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

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

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

cnt = 0
minimun = max(l)
for i in range(n):
    if l[i] <= minimun:
        cnt += 1
        minimun = l[i]
print(cnt)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
curmin = 2*10**5+1
ans = 0

for i in p:
    if curmin >= i:
        curmin = min(curmin, i)
        ans += 1

print(ans)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
curmin = 2*10**5+1
ans = 0

for i in p:
    if curmin >= i:
        curmin = min(curmin, i)
        ans += 1

print(ans)

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

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

for i,p in enumerate(P) :
    if i == 0 :
        minlist.append(p)
        continue

    if p < minlist[i-1] :
        minlist.append(p)
    else:
        minlist.append(minlist[i-1])
    
for i,p in enumerate(P) :
    pj_min = minlist[i]
    if p <= pj_min :
        count += 1
    
print(count)

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

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

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

Solution (Python):
import sys


def resolve(in_):
    N = int(next(sys.stdin.buffer))
    P = map(int, next(sys.stdin.buffer).split())

    min_ = 200001
    ans = 0
    for p in P:
        if p <= min_:
            ans += 1
            min_ = p
    return ans


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
L=list(map(int,input().split()))
num=1
min_num=0
for i in range(n):
    if i==0:
        min_num=L[0]

    elif min_num>=L[i]:
        num+=1
        min_num=L[i]

print(num)

Solution (Python):
'''
Created on 2020/08/17

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

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

main()

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

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

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

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

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

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

c = 1
a = d[0]

for i in range(1,N):
  if d[i] <= a:
    c += 1
    a = d[i]

print(c)

Solution (Python):
number = int(input())
score = list(map(int,input().split()))
minn = score[0]
answer = 0
for i in range(number):
    if minn >= score[i]:
        answer += 1
        minn = score[i]
print(answer)

Solution (Python):
import math


def resolve():
    import sys
    input = sys.stdin.readline
    
    
    n = int(input().rstrip())
    past_max = float("inf")
    ans = 0
    for p in [int(p) for p in input().rstrip().split(" ")]:
        if p < past_max:
            past_max = p
            ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()

Solution (Python):
input()
P=map(int,input().split())
ans,mn=0,2*10**5
for x in P:
    if mn>=x: ans+=1; mn=x
print(ans)

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    P = LI()
    ans = 0
    min_num = P[0]
    for i in range(N):
        if min_num>=P[i]:
            ans += 1
            min_num = P[i]

    print(ans)

main()

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
P = inpl()

min = 10**5 * 2 + 10
cnt = 0
for p in P:
    if min >= p:
        min = p
        cnt += 1

print(cnt)

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

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]
score=0
min_val=A[0]
for i in A:
  if i<=min_val:
    score+=1
    min_val=i
print(score)

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

ans=0

min_=p[0]

for pp in p:
  min_=min(min_,pp)
  if min_ ==pp:
    ans+=1

print(ans)

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

lmin=10**10
ans=0

for pp in p:
    ans+=1 if pp<=lmin else 0
    lmin=min(pp,lmin)

print(ans)

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, P: "List[int]"):
    ans = 0
    l = INF
    for pi in P:
        l = min(l, pi)
        if pi <= l:
            ans += 1
    return ans


def main():

    sys.setrecursionlimit(10 ** 6)

    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)]  
    print(f'{solve(N, P)}')


if __name__ == '__main__':
    main()

Solution (Python):
import sys

N = int(sys.stdin.readline().rstrip())
P = [int(x) for x in sys.stdin.readline().rstrip().split()]

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

print(cnt)

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

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

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

print(cnt)

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

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

Solution (Python):

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

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

Solution (Python):
import os, sys, re, math

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

answer = 0
m = 2 * 10 ** 5
for p in P:
    if p <= m:
        answer += 1
        m = p

print(answer)

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

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

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

cnt = 0
min_val = 10 ** 8
for p in P:
    if p <= min_val:
        min_val = p
        cnt += 1

print(cnt)

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

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

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

print(count);

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
minnumber=1e9
count=0

for i in p:
  if i<=minnumber:
    count+=1
    minnumber=i
    
print(count)

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

cnt = 0
p_min = 2*10**5+1
for i in range(n):
    if p_min >= p[i]:
        cnt += 1
    p_min = min(p_min, p[i])

print(cnt)

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

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

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

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

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

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


for i in P:
    if i == 1:
        ans += 1
        x = 1
    else:
        if x >= i:
            ans += 1
            x = i



            
    
print(ans)

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

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
Q = []
m = 10**17
for p in P:
    m = min(m, p)
    Q.append(m)
c = 0
for x, y in zip(P, Q):
    if x <= y:
        c += 1
print(c)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
Q = []
m = 10**17
for p in P:
    m = min(m, p)
    Q.append(m)
c = 0
for x, y in zip(P, Q):
    if x <= y:
        c += 1
print(c)

Solution (Python):
def main():
    N = int(input())
    m = float("inf")
    ans = 0

    for i in [int(j) for j in input().split()]:
        if i < m:
            m = i
            ans += 1
    
    print(ans)

if __name__ == '__main__':
    main()

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

minP = N
count = 0

for pi in map(int, input().split()):
    minP = min(minP, pi)

    if pi <= minP:
        count += 1

print(count)

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

check=200001
cnt=0
for i in p:
	if check > i:
		check = i
		cnt+=1
print(cnt)

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

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

check=200001
cnt=0
for i in range(n):
	if check > p[i]:
		check = p[i]
		cnt+=1
print(cnt)

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

cnt=1

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

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

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

print(ans)

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

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

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

min = P[0]
ans = 0

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

print(ans)

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

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

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

print(c)

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

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

cnt = 10**18
ans = 0

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

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

print(ans)

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

n = N+1
cnt = 0
for i in P:
    if i <= n:
        cnt += 1
        n = i

print(cnt)

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
P = inintl()

min_l = []
now_min = P[0]
ans = 0

for p in P:
    if p < now_min:
        now_min = p
    min_l.append(now_min)

for i in range(n):
    if min_l[i] == 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):
    m.append(min(m[i - 1], p[i]))
    if m[i] == p[i]:
        c += 1
print(c)

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

Solution (Python):
n=int(input())
p=list(map(int,input().split()))
cnt=0
tiny=float('inf')

for i in range(n):
  if tiny>=p[i]:
    cnt+=1
    tiny=p[i]
  else:
    pass
    
print(cnt)

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

for p in P:
  if p<s:
    a+=1
    s=p

print(a)

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

for p in P:
  if p<s:
    a+=1
  s = min(s,p)

print(a)

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

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())
List = list(map(int, input().split()))
res = 1
mini = List[0]
for i in range(1,N):
  if List[i] <= mini:
    res += 1
  mini = min(List[i],mini)
print(res)

Solution (Python):
def resolve():
    N = int(input())
    P = list(map(int, input().split()))
    tmpmin = float("inf")
    ans = 0
    for p in P:
        if tmpmin > p:
            ans += 1
        tmpmin = min(tmpmin, p)
    print(ans)

if '__main__' == __name__:
    resolve()

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

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

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

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

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

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


if __name__=="__main__":
    main()

Solution (Python):
N,*P = map(int, open(0).read().split())
m = P[0]
ans = 0
for x in P:
    if x <= m:
        m = x
        ans += 1
print(ans)

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










ans = 0
min_left = 2 * 10**5
for i in range(n):
    min_left = min(min_left,p[i])
    if min_left >= p[i]:
        ans += 1
print(ans)

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

mins = [P[i] for i in range(N)]

for i in range(1, N):
    if mins[i] > mins[i-1]:
        mins[i] = mins[i-1]


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

print(ans)

Solution (Python):

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

ans = 0
cur = 10 ** 6
for i in range(N):
    if X[i] <= cur:
        ans += 1
    cur = min(cur, X[i])

print(ans)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
count=0
mi=N+1
for a in A:
  if a < mi:
    count+=1
    mi = a
print(count)

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

now_min=float('inf')
cnt=0
for i in range(n):
  if p[i]<=now_min:
    cnt+=1
    now_min=p[i]
  
print(cnt)

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

if __name__ == "__main__":
    solve()

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

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

dp = [0] * N

dp[0] = P[0]

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

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

print(res)

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

tmpmin = float('inf')
cnt = 0
for pi in p:
    if tmpmin >= pi:
        cnt += 1
        tmpmin = pi

print(cnt)

Solution (Python):
def main():

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

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

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

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

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

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

min_p = 2 * ( 10 ** 5 )
cnt = 0

for p_i in p:
    if min_p >= p_i:
        min_p = p_i
        cnt += 1

print( cnt )

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

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

s = a[0]
count = 1

for i in range(1,N):
  s = min(s,a[i-1])
  if s>=a[i]:
    count+=1
    
print(count)

Solution (Python):

def solve():

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


if __name__ == "__main__":
    N = int(input())
    P = list(map(int, input().split()))
    solve()

Solution (Python):
N,*a = map(int,open(0).read().split())
max_num = a[0]
count = 0
for i in a:
  if max_num>=i:
    count+=1
  max_num = min(i,max_num)
print(count)

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

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

a = Pli[0]
res = 1

for i in range(1,N):
  if Pli[i] <= a:
    a = Pli[i]
    res += 1
    
print(res)

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

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

print(cnt)

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

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

print(cnt)

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

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

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

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

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


print(count)

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

n=int(input())
L=list(map(int,input().split()))
MIN = 1<<30
ans = 0
for i in L:
    MIN = min(MIN,i)
    if i<=MIN:
        ans+=1
print(ans)

Solution (Python):


"""
https://atcoder.jp/contests/abc152/tasks/abc152_c
Low Elements.
"""
def solve(a, n):
    ans = 1
    mi = a[0]

    for i in range(1, n):
        mi = min(mi, a[i])
        if mi == a[i]: ans += 1

    return ans

if __name__ == "__main__":
    n = int(input())
    a = [(lambda x: int(x))(x) for x in input().split()]

    print(solve(a, n))

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

def main(n,p):
    count=0
    pmin=p[0]
    for i in range(n):
        pmin=min(p[i],pmin)
        if pmin>=p[i]:
            count+=1
    return count

if __name__=='__main__':
    n,p=readinput()
    ans=main(n,p)
    print(ans)

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

def main(n,p):
    count=0
    pmin=p[0]
    for i in range(n):
        pmin=min(p[i],pmin)
        if pmin>=p[i]:
            count+=1
    return count

if __name__=='__main__':
    n,p=readinput()
    ans=main(n,p)
    print(ans)

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

m = 10**6
cnt = 0
for i in range(n):
    if m >= a[i]:
        cnt += 1
        m = a[i]
print(cnt)

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import itertools

n = int(stdin.readline().rstrip())
p = [int(x) for x in stdin.readline().rstrip().split()]

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

print(count)

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

mn = N + 1
ans = 0
for p in P:
    if p < mn:
        ans += 1
    mn = min(mn, p)
print(ans)

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

minp =[p[0]]

for i in range(1,n):
    minp.append(min(minp[i-1],p[i]))


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

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

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

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

Solution (Python):
import math


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    P = read_ints()
    min_so_far = math.inf
    count = 0
    for p in P:
        min_so_far = min(min_so_far, p)
        if min_so_far >= p:
            count += 1
    return count


if __name__ == '__main__':
    print(solve())

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    N = II()
    p = LI()

    ans = 0
    min_now = p[0]

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

    print(ans)


main()

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

vmin = max(P)
vmax = 0

cnt = 0
for p in P:
  if p <= vmin:
    cnt += 1
  if p < vmin:
    vmin = p
  if vmax < p:
    vmax = p
    
print(cnt)

Solution (Python):
import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()


N = int(input())
P = inpl()
mn = 1001001001
ans = 0
for i in P:
    mn = min(mn, i)
    if i == mn:
        ans += 1
print(ans)


ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

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

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

now_mini= 1<<20
for i in P:
    if i < now_mini:
        count = count + 1
        now_mini=i
print(count)

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

Solution (Python):
N = int(input())
ls = list(map(int,input().split()))
ii = 0
minls = N
for i in range(N):    
    if ls[i] <= minls:
        ii += 1
    minls = min(minls,ls[i])

print(ii)

Solution (Python):
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


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

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

  print(cnt)


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

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

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

Solution (Python):
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n = int(lines.pop(0))
p_list = [int(n) for n in lines[0].split(" ")]

def _iter_minimum():
    prev = sys.maxsize
    for p in p_list:
        m = min(prev, p)
        yield m
        prev = m

mininum_list = list(_iter_minimum())

count = 0
for p, m in zip(p_list, mininum_list):
    if p == m:
        count += 1

print(count)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N =I()
_P= LI()


P = np.array(_P)



def main():
    
    
    
    
    
    
    
    
    
    
    
    

    Q = np.minimum.accumulate(P)
    count = np.count_nonzero(P <= Q)
    return count

print(main())

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

ans = 0
min_p = p[0]

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

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

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

count = 0
min_value_dic = {}
min_value_so_far =1e6
for i in range(N):
    if P_list[i] < min_value_so_far:
        min_value_dic[i] = P_list[i]
        min_value_so_far = P_list[i]
    else:
        min_value_dic[i] = min_value_so_far



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

print(count)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    p=LIST()
    tm=10**9
    ct=0
    for i in range(n):
        if tm>=p[i]:
            ct+=1
        tm=min(tm,p[i])
    print(ct)

if __name__=='__main__':
    do()