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())
List = list(map(int, input().split()))
count = 1
min = List[0]

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

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

count = 0
minimum = 2 * 10 ** 5 + 1
for p in P:
    if p < minimum:
        count += 1
        minimum = p
print(count)

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

if __name__ == "__main__":
    main()

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

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

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

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

print(cnt)

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

dummy = 2*10**5
answer = 0

for p in P:
  if p <= dummy:
    answer += 1
    dummy = p

print(answer)

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

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

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

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

Solution (Python):
if __name__=="__main__":
    n = int(input())
    args = input().split()
    p = []
    for i in range(len(args)):
        p.append(int(args[i]))

    cnt = 1
    p_pre = [p[0]]
    min_p_pre = p[0]
    for i in range(1,len(args)):
        p_pre.append(p[i])
        min_p_pre = min(min_p_pre, p[i])
        if p[i] == min_p_pre:
            cnt += 1

    print(cnt)

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

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

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

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

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

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


ans = 0
min_ = 999999
for i in l:
    if i <= min_:
        min_ = i
        ans += 1

print(ans)

Solution (Python):

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

m = []
mm = 10**8
for i in range(n):
    mm = min(mm,pl[i])
    m.append(mm)

res = 0
for i in range(n):
    if pl[i]==m[i]:
        res += 1

print(res)

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

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

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


for index, i in enumerate(A):
    if index == 0:
        ans += 1
        small = i


    elif small >= i:
        ans += 1
        small = i      

print(ans)

Solution (Python):
class FenwickTree:
    """FenwickTree (Binary Indexed Tree, 0-index)

    Queries:
        1. add(i, val): add val to i-th value
        2. sum(n): sum(bit[0] + ... + bit[n-1])

    complexity: O(log n)

    See: http://hos.ac/slides/20140319_bit.pdf
    """

    def __init__(self, a_list):
        self.N = len(a_list)
        self.bit = a_list[:]
        for _ in range(self.N, 1 << (self.N - 1).bit_length()):
            self.bit.append(0)
        for i in range(self.N-1):
            self.bit[i | (i+1)] += self.bit[i]

    def add(self, i, val):
        while i < self.N:
            self.bit[i] += val
            i |= i + 1

    def sum(self, n):
        ret = 0
        while n >= 0:
            ret += self.bit[n]
            n = (n & (n + 1)) - 1
        return ret

    def query(self, low, high):
        return self.sum(high) - self.sum(low)


N = int(input())
P = [int(x) for x in input().split()]
P_idx = [(x, i) for i, x in enumerate(P)]
P_idx.sort()
fwt = FenwickTree([0] * N)
ans = 0
for x, idx in reversed(P_idx):
    if fwt.sum(idx) == idx:
        ans += 1
    fwt.add(idx, 1)
print(ans)

Solution (Python):
n = input()
N = int(n)
P = []
counter = 0
input_string = input()
P = input_string.split()

for i in range(int(N)):
    for j in range(N):
        if N == int(P[i]):
            counter = counter + 1
            if N != 1:
                N = N - 1
                break
            else: 
                break
        elif N < int(P[i]):
            break
        else:
            if N != 1:
                N = N - 1   

print(counter)

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

Solution (Python):


N = int(input())
P = input().split()
T = []
L =0
T.insert(0,int(P[0]))
P[0] = int(P[0])
for i in  range(1,len(P)):
  P[i] = int(P[i])
  if T[-1]>=P[i]:
    L =+ 1
    if T[-1]>P[i]:
      T.append(P[i])
print(len(T))

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


cut = N
check =0
min = N

for i in range(1,N+1):
    
    if List[i-1]<=min:
        min = List[i-1]
        
    else:
        cut -=1

    




print(cut)

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

Solution (Python):
def main():
    from sys import stdin, setrecursionlimit
    
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    
    
    
    a = list(map(int, r.split()))
    
    
    

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
















if __name__ == '__main__':
    main()

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

minValue = 2*(10**5)
result = 0
for element in PN:
    if minValue >= element:
        minValue = element
        result += 1
print(result)

Solution (Python):
n = int(input())
tl = input().split()

l = [int(i) for i in tl]

mn = n

count = 0
mn_i = 0
for i in range(len(l)):
    if l[i] > mn:
        continue

    sl = l[mn_i:i+1]
    mn = min(sl)
    mn_i = i
    count += 1

print(count)

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

Solution (Python):


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

ok = 1
minp = [p[0]]

for i in range(1,n):
    if p[i] < minp[i-1]:
        minp.append(p[i])
        ok = ok + 1
    else:
        minp.append(minp[i-1])

print(ok)

Solution (Python):
n = int(input())
ps = list(map(int, input().split()))
fps = [ps[0]]
for i in range(1,n):
  if fps[len(fps)-1] > ps[i]:
    fps.append(ps[i])
print(len(fps))

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

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

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

Solution (Python):
def main():
    N = int(input())
    lists = list(map(int, input().split(' ')))
    min_i = (2 * 10) ** 5 + 1
    cnt = 0
    for item in lists:
        if min_i >= item:
            min_i = item
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

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

ps3 = p[0]

ans = 0
for i,name in enumerate(p):
    if name <= ps3:
        ans += 1
    ps3 = min(ps3, name)
print(ans)

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

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

print(ans)

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

ans = 0
min_v = P[0]

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

print (ans)

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

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

'''
選んだ数字(iで場所指定)より、左の数字が全て大きい。
'''
c = 0
MIN = p[0]
for i in range(n):
    if p[i] <= MIN:
        c += 1
        MIN = p[i]

print(c)

Solution (Python):
def acinput():
    return list(map(int, input().split(" ")))

N=int(input())
P=acinput()

minv=10**6

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

print(count)

Solution (Python):
n = input()
N = int(n)
P = []
counter = 0
input_string = input()
P = input_string.split()

for i in range(int(N)):
    for j in range(N):
        if N == int(P[i]):
            counter = counter + 1
            if N != 1:
                N = N - 1
                break
            else: 
                break
        elif N < int(P[i]):
            break
        else:
            if N != 1:
                N = N - 1   

print(counter)

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

min = i[0]
count = 1

for n in range(N-1):
    if min >= i[n+1]:
        min = i[n+1]
        count +=1
    else: pass

print(count)

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

Solution (Python):
N=int(input())
S=input().split()
NS = [int(i) for i in S]
def minL():
  ml=[NS[0]]
  for i in range(1,N):
     ml+=[min(ml[i-1],NS[i])]
  return ml  

MINL=minL()
def exist():
    s=0
    for i in range(N):
      if MINL[i]>=NS[i]:
         s+=1
    return s
if __name__=='__main__':
   print(exist())

Solution (Python):
N, = map(int, input().split())
xs = map(int, input().split())
r = N+1
c=0
for x in xs:
    if x<r:
        c += 1
    r = min(r,x)
print(c)

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

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

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
l1=[]
c=0
l1.append(l[0])
for i in range(1,n):
  l1.append(min(l1[i-1],l[i]))
for i in range(n):
  if(l[i]==l1[i]):
    c+=1
print(c)

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

count = N
m = 10**9

for i in range(N):
    if m != max(m,P[i]):
        count -= 1
    m = min(m,P[i])

print(count)

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt
from fractions import gcd
from itertools import permutations

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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



N = intinput()


datas = list(mulinputs())


M = 1001000
cnt = 0
l = len(datas)













dmap = dict()
for i in range(1, len(datas)+1):
    dmap[datas[i-1]] = i
counter = N
for i in range(1, len(datas)+1):
    if dmap[i]-1 > counter:
        continue
    counter -= (counter - (dmap[i]-1))
    cnt +=1
    if counter <=0:
        break



print(cnt)

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:
        pass
    else:    
        count += 1

    if p[i] <= minp:
        minp = p[i]

print(count)

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

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




SUCCESS = N
pre_max = P[0]
pre_min = P[0]
for i in range(N):
    j = i - 1

    if pre_min < P[i]:
        SUCCESS -= 1
        continue
    else:
        pre_min = P[i]
print(SUCCESS)

Solution (Python):
n = input()
N = int(n)
P = []
counter = 0
input_string = input()
P = input_string.split()

for i in range(int(N)):
    for j in range(N):
        if N == int(P[i]):
            counter = counter + 1
            if N != 1:
                N = N - 1
                break
            else: 
                break
        elif N < int(P[i]):
            break
        else:
            if N != 1:
                N = N - 1   

print(counter)

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

Solution (Python):

def checkFront(start,a):
  global smallest
  nowIndex = start
  if(a[start] > smallest):
      
      return 0
  else:
    smallest = a[start]
    return 1

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

smallest = a[0]
ans = 0

for i in range(n):
  ans += checkFront(i,a)
print(ans)

Solution (Python):
m = input()
arr = input().split()
cnt = 0
flg = 1
mnn = arr[0]
for n in arr:
  if(int(n)>int(mnn)):
    continue
  else:
    mnn = n
    cnt = cnt + 1
print(cnt)

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

result = 1
com_val = p[0]

for i in range(1, n):
    if com_val < p[i]:
        continue
    else:
        result += 1
        com_val = p[i]

print(result)

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

islow = True
counter = 0
min = 0

for i in range(len(plist)):
    islow = True
    if i == 0:
        counter += 1
        min = plist[i]
        current_min = i
    elif min > plist[i]:
        counter += 1
        min = plist[i]
        current_min = i
        
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):
    cnt += 1
    min = p[i]

print(cnt)

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

cnt = 0
for i,v in enumerate(p):
    if i == 0:
        cnt += 1
        min_ = v
        continue
    if min_ > v:
        min_ = v
        cnt += 1
print(cnt)

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

ans=1
ch=num[0]
for i in range(1,n):
  if  num[i]<=ch:
    ans+=1
  ch=min(ch,num[i])
print(ans)

Solution (Python):
n=int(input())
a=[int(x) for x in input().split()]
arr=[]
minn=2*(10**5)+1
for i in range(n):
    if a[i]<minn:
        minn=a[i]
    arr.append(minn)

co=0
for i in range(len(arr)):
    if arr[i]>=a[i]:
        co+=1
print(co)

Solution (Python):
n = input()
p = input().split()

i_cnt = 1
current_max = {'idx': 0, 'value': 0}

for j in range(len(p)):
  for i in range(current_max['idx'], j):
    current_max['idx'] = i
    if current_max['value'] <= int(p[i]): 
      current_max['value'] = int(p[i])
    if int(p[i]) < int(p[j]):
      break
    if j-1 == i:
      i_cnt += 1

print(i_cnt)

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

Solution (Python):
def solve(n, p_list):

    count = 0
    j = 2 * 10**5 +1
    for i in p_list:
        if j > i:
            count += 1
            j = i

    return count

if __name__ == "__main__":

    n = int(input())
    p_list = [int(i) for i in input().split()]
    ans = solve(n, p_list)
    print(ans)

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

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

print(cnt)

Solution (Python):
N = int(raw_input())
array = map(int, raw_input().split())

num = 0
min_num = array[0]

for i in range(0,N):
    if min_num >= array[i]:
        num += 1
        min_num = array[i]

print num

Solution (Python):
n = int(input())
list = list(map(int,input().split(" ")))
result = n
tem = list[0]
for i in range(n):
    if tem >= list[i]:
        tem = list[i]
    else:
        result -= 1

print(result)

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

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

Solution (Python):


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


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

print(count)

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

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

ans = 0

c = p[0]

for i in range(n):
    

    if c >= p[i]:
        c = p[i]
    if c >= p[i]:
        ans += 1
print(ans)

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

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

Solution (Python):
n = int(input())
p = [int(e) for e in input().split()]
count=0
p_min=p[0]

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

        p_min=p[i]

print (count)

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

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

print(count)

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

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

cnt = 0
x = p[0]

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

Solution (Python):
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().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())
l = list(map(int, input().split(' ')))

min = 2*10**5 + 1
count = 0

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

print(count)

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

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

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

        tmp = min(tmp, P[i])
        if P[i] <= tmp:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
loop = int(input())
num_list = list(map(int, input().split()))
ans = 0
min_value = 20000000
for n in num_list:
  flg = True
  if min_value < n:
    flg = False
  else:
    min_value = n
  if flg:
    ans += 1
print(ans)

Solution (Python):


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

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

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

ans_ls=[0]
ans=1

for i  in range(1,N):
    if P[ans_ls[-1]]>P[i]:
        ans+=1
        ans_ls.append(i)
    
    '''
    if P[i-1]<P[i]:
        pass
    
    elif P[i-1]>P[i] and ans[-1]==(i-1):
        ans.append(i)
        
    elif ans[-1]==
    '''
    
print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
ans = 0
min_number = 2*10**5+1

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

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

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

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

Solution (Python):
n=int(input())
p=map(int,input().split())
mini=n+1
count=0
for x in p:
    if x < mini:
        mini = x
        count = count+1
    if x == 1:
        break
print(count)

Solution (Python):
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

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

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

Solution (Python):
n,*p=map(int,open(0).read().split())
_min=max(p)
cnt=0
for i in p:
  _min=min(_min,i)
  if i>_min:
    cnt+=1
print(n-cnt)

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

        if data[i]<=minmin:
            minmin=data[i]
            
            ans+=1
                
        
            

print(ans)

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

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

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

print(res)

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

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

result = 0
last = Pn[0]  

for i in Pn:
    if int(last) >= int(i):
        result += 1
        last = int(i)

print(result)

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

x = P[0]
ans = 0

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

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

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

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

print(N - NG_count)

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

P_list = input().split()

P_list_int = [int(p) for p in P_list]


correct_cnt = 0
min_val = 200000
for i in range(N):
    if(P_list_int[i] <= min_val):
        min_val = P_list_int[i]
        correct_cnt += 1

print(correct_cnt)

Solution (Python):
N = int(input())
tmp = input().split(" ")
l = [int(i) for i in tmp]
ans = 1
ll = list()
ll.append(l[0])
for i in range(1,N):
    ll.append(min(ll[i-1],l[i]))
for i in range(1,N):
  if ll[i-1] > l[i]:
    ans+=1
print(ans)

Solution (Python):
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = int(Pi)

    elif Pmin>=int(P[i]):
        count = count +1
        Pmin = int(Pi)


print(count)

Solution (Python):
total = input()
L = list(map(int, input().split()))
sum=0
Q=0
for i in range(int(total)):
  if i == 0:
    Q=L[i]
    sum = sum  + 1
  else:
    if Q>=L[i]:
      sum = sum  + 1
      Q=L[i]
print(sum)

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


count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)

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

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

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

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

Solution (Python):
n = int(input())
p_arr = list(map(int, input().split()))
min_i = 9999999999999999999999999
res = 0
for i in p_arr:
  if i == 1:
    res += 1
    break
  else:
    if i < min_i:
      res += 1
      min_i = i
print(res)

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

print(count)

Solution (Python):
import sys

n_in = input()
result = input().split()
total = 0
n_in = int(n_in)
p_min = int(result[0])
for k0 in range(n_in):
    count = 0
    if int(result[k0]) <= p_min:
        total += 1
        p_min = int(result[k0])

print(total)

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

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

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

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

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



resultCount = 0
minNum = P[0]
for i in range(N):
    isMitasu = True
    if i != 0:
        if P[i] > minNum:
            isMitasu = False
        else:
            
            minNum = P[i]
    if isMitasu:
        resultCount += 1
print(resultCount)

Solution (Python):
n = int(input())
li = list(map(int, input().split()))
tmpMin = li[0]
count = 0

for i in range(n):
    if li[i] <= tmpMin:
        tmpMin = li[i]
        count += 1

print(count)

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

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))

Solution (Python):


import sys
input=sys.stdin.readline

n=int(input())
p=list(map(int,input().split()))
P=[]
cnt=0
lowest=float("inf")

for i in p:
    if i<=lowest:
        lowest=i
        cnt+=1

print(cnt)

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

cnt = 1
m = p[0]

for i in range(1,len(p)):
    if m >= p[i]:
        cnt+=1
    
    m = min(m,p[i])
    
print(cnt)

Solution (Python):

n = int(input())
P = list(map(int, input().split()))
min_ = 10**6
cnt = 0
for i in range(n):
    if min_ > P[i]:
        cnt += 1
        min_ = P[i]
print(cnt)

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

minus_count = 0
rember_number = 0
for i, x in enumerate(c_list):
    if i == 0:
        rember_number = x
        continue
    else:
        if x < rember_number:
            rember_number = x
        if x > rember_number:
            minus_count += 1

print(len(c_list) - minus_count)

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

res = 0
aa = p[0]
for i in p:
     if aa >= i:
         res += 1
         aa = i

print(res)

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

now = num[0]
cnt = 1
for i in range(1,n):
    if (now > num[i]):
        cnt+=1
        now = num[i]
    
print(cnt)

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

Max = P[0]
count = 1

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


print(count)

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

Solution (Python):
import sys

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

ans = 0
max = -1
min = sys.maxsize

for i in range(a):
    
    c = b[i]

    if c <= min:
        min = c

    if c <= max and c <= min or i == 0:
        ans += 1

    if c >= max:
        max = c

print(ans)

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

pmin = P[0]

m = 1

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

print(m)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
Nflag = 0
count = 0
tmp = float("inf")
for i in P:
    if i<tmp:
        tmp=i
    else:
        count+=1
print(N-count)

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

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

print(count)

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

max = p[0]
ans = 0

for i, v in enumerate(p):
   if max >= v:
       ans += 1
       max = v

print(ans)

Solution (Python):


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

if __name__ == '__main__':
  main()