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

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

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

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

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

count = 0
min_value = 2e5+1

for p in P:
	if p <= min_value:
		min_value = p
		count += 1

print(count)

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

count = 0
minL = pList[0] 
for i in range(n):
  if minL >= pList[i]:
      count += 1
      minL = pList[i] 
      if minL == 1:
        break

print(count)

Solution (Python):
n = int(input())
permutation = [int(x) for x in input().split()]
minimum, count = permutation[0], 0  

for p_i in permutation:
  
  if p_i > minimum:
    count += 1
  else:
    minimum = p_i
    
print(n - count)

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

MIn, MAn = [float("inf")] * N, [-float("inf")] * N
mi, ma = float("inf"), -float("inf")
for i in range(N):
    mi = min(mi, Pn[i])
    ma = max(ma, Pn[i])

    MIn[i], MAn[i] = mi, ma

ans = 1
for i in range(N):
    if Pn[i] == MIn[i] and Pn[i] < MAn[i]:
        ans += 1

print(ans)

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]
mins = [0]*N
mins[0] = P[0]
for n in range(1,N):
    mins[n] = min(P[n],mins[n-1])
ans = 0
for i in range(N):
    if P[i] == mins[i]:
        ans += 1
print(ans)

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

ans = 1
base = p[0]

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

print(ans)

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

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

count = 0
minimum = P[0]

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

Solution (Python):
import unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([4, 2, 5, 1, 3]), 3)

    def test_2(self):
        self.assertEqual(think([4, 3, 2, 1]), 4)

    def test_3(self):
        self.assertEqual(think([1, 2, 3, 4, 5, 6]), 1)

    def test_4(self):
        self.assertEqual(think([5, 7, 4, 2, 6, 8, 1, 3]), 4)

    def test_5(self):
        self.assertEqual(think([1]), 1)


def solve():
    p = read()
    result = think(p)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(p):
    dp = [0 for _ in range(len(p) + 1)]
    count = 1
    dp[1] = p[0]
    for i in range(1, len(p)):
        if p[i] <= dp[i]:
            count += 1
            dp[i + 1] = p[i]
        else:
            dp[i + 1] = dp[i]
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    
    solve()

Solution (Python):
N=int(input())
P = list(map(int, input().split()))
P_min=P[0]
count=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()))

cnt=0

import numpy as np

P=np.array(P)

max_val=P[0]

cnt=1

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

    if max_val > P[i]:
        cnt+=1

print(cnt)

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

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

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

min = p[0]
c=0
for i in p:
    if min >=i:
        min = i
        c+=1

print(c)

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

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split(" ")))
    minimum = 10 ** 6
    result = 0
    for p in P:
        if minimum > p:
            result += 1
            minimum = p
    print(result)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
p=[int(x) for x in input().split()]
s=0
t=n+1
for c in range(n):
    if p[c]<t:
        s+=1
        t=p[c]
print(s)

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

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

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

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

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

cnt = 0
min1 = L[0]
for i in range(n-1):
    min1 = min(min1,L[i])
    if L[i+1]<=min1:
        
        cnt +=1
print(cnt+1)

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

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

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

print(ans)

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

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

print(ans)

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

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
ANS=0

TMP_MIN = L[0]

for i in range(0,N):
  
  if TMP_MIN >= L[i]:
    TMP_MIN = L[i]
    ANS += 1    
print(ANS)

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

ans = 0
minp = p[0]

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

print(ans)

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

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


print(cnt)

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

mx = 10 ** 19
ans = 0
for i in p:
  if i < mx:
    mx = i
    ans += 1
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
def print_ans(N, P):
    """Test Case
    >>> print_ans(5, [4, 2, 5, 1, 3])
    3
    >>> print_ans(4, [4, 3, 2, 1])
    4
    >>> print_ans(6, [1, 2, 3, 4, 5, 6])
    1
    >>> print_ans(8, [5, 7, 4, 2, 6, 8, 1, 3])
    4
    >>> print_ans(1, [1])
    1
    """
    min_num = P[0]
    counter = 1
    for i in range(1, N):
        if min_num >= P[i]:
            counter += 1
        min_num = min(min_num, P[i])
    print(counter)



if __name__ == '__main__':
    N = int(input().rstrip())
    P = list(map(int, input().rstrip().split()))
    print_ans(N, P)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	P = inputList()

	ans = 0
	mmin = 0
	for i,val in enumerate(P):
		if i == 0:
			ans += 1
			mmin = val
			continue

		if val <= mmin:
			ans += 1
			mmin = val
			
		else:
			pass

	print(ans)



if __name__ == "__main__":
	main()

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



Ans = 0
min = N

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

print(Ans)

Solution (Python):

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

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

print(ans)

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

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

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

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

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

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

m = N + 1
cnt = 0

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

print(cnt)

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

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

count=1
temp=pl[0]
l=[pl[0]]
for i in range(1,n):
    if pl[i]<temp:
        temp=pl[i]
        l.append(temp)
    else:
        l.append(temp)
    if pl[i]<=temp:
        count+=1
print(count)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N = inputInt()
	P = inputList()

	ans = 0
	mmin = 0
	for i,val in enumerate(P):
		if i == 0:
			ans += 1
			mmin = val
			continue

		if val <= mmin:
			ans += 1
			mmin = val
			
		else:
			pass

	print(ans)



if __name__ == "__main__":
	main()

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

num = 0
num_min = 2 * 10**5 + 1
i = 0

while i < N:
  if num_min >= int(P[i]):
    num += 1
    num_min = int(P[i])
  i += 1

print(num)

Solution (Python):
import sys

N = int(input())
P = [int(v) for v in input().split()]
cnt = 0
M = 3 * 10 ** 5
for i in range(N):
    if M > P[i]:
        cnt += 1
    M = min(M,P[i])
print(cnt)

Solution (Python):





from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit










setrecursionlimit(10**6)
input=stdin.readline

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

Solution (Python):
def main():
    n = int(input())
    ps = list(map(int, input().split()))
    ans = 0
    minp = float("inf")
    for p in ps:
        minp = min(minp, p)
        if minp >= p:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

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

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

sum = 0
smallest = 1

for i in range(n):

    if i == 0:
        sum += 1
        smallest = arr[i]
    else:
        if arr[i] > smallest:
            continue
        else:
            smallest = arr[i]
            sum += 1

print(sum)

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

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

print(ans)

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

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

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

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

print(count)

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

mp = PP[0]
count = 0
for i in range(N):
    if PP[i] <= mp:
        count += 1
        mp = PP[i]
    else:
        pass

print(count)

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

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

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


if __name__ == '__main__':
    main()

Solution (Python):


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

result = []
c = 0
smallest = p[0]
for i in range(0,n):
    flag = 0
    if smallest >= p[i]:
        c += 1
        smallest = p[i]

print(c)

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

count = 1
min_e = pl[0]
for e in pl[1:]:
    if (e < min_e):
        count += 1
        min_e = e
print(count)

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

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split()))
    
    count = 0
    k = 0
    for i in range(N):
        flag = True
        for j in range(k, i):
            if P[i] > P[j]: 
                flag = False
                break

        if flag:
            count += 1
            k = i
            
    print(count)
if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


def fetch_ints_inputs(times):
    return [fetch_int_input() for _ in range(times)]

N = int(fetch_one_line())
nums = fetch_int_input()

min_num = 999999999999999999
count = 0

for num in nums:
    if min_num >= num:
        count += 1
        min_num = num

print(count)

Solution (Python):
import sys

readline = sys.stdin.buffer.readline

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

M = P[0]
cnt = 0

for p in P:
    if p <= M:
        cnt += 1
        M = min(p, M)

print(cnt)

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

ret = 0
m = 9999999999
for i, n in enumerate(P):
    if n <= m:
        ret += 1
        m = n
print(ret)

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

min_dp = [-1] * N

min_dp[0] = P[0]

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

print(ans)

Solution (Python):


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

_min = ps[0]
mins = []
for p in ps:
    if p < _min:
        _min = p
    mins.append(_min)

count = 0
for i in range(n):
    if ps[i] <= mins[i]:
        count+=1

print(count)

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

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

cnt = 0
p_min = P[0]

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

    if P[i] < p_min: 
        p_min = P[i]

print(cnt)

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

if __name__=='__main__':
    main()

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

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

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

print(ans)

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

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

cnt = 1
chk = P[0]

for p in P:
    if p < chk:
        cnt += 1
        chk = p

print(cnt)

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
i=0
a=1
min=p[0]
while True:
  if min>p[i]:
    min=p[i]
    a+=1    
  if p[i]==1:
    break
  i+=1
print(a)

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

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

print n

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

total = 0

equi = P_i[0]

for i in range(N):
    if equi >= P_i[i]:
        total += 1
        equi = P_i[i]

print(total)

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

min_val=float("inf")

ans=0
for x in P:
    if x<=min_val:
        min_val=x
        ans+=1
print ans

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

cnt = 1
chk = P[0]

for p in P:
    if p < chk:
        cnt += 1
        chk = p

print(cnt)

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

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

print(ans)

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

Solution (Python):

"""
Created on Sun Jan 19 21:04:49 2020

@author: masat
"""

N = int(input())

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



min_Pj = P_list[0]
counter = 0
for Pi in P_list:
    min_Pj = min(min_Pj, Pi)
    
    if Pi <= min_Pj:
        counter += 1
    else:
        pass

print(counter)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)

from bisect import *
from collections import *
from heapq import *



INF = 500000
mod = 10**9+7

N = int(input())
A = [int(x) for x in input().split()]
M = INF
ans = 0
for a in A:
    if a < M:
        ans += 1
        M = a
print(ans)

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

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

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

_min = p[0]
ans = 0

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

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

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

print(ans)

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

	
	ansl = []
	ansl.append(a[0])
	i = 1
	if n == 1:
		pass
	elif a[0] >= a[1]:
		ansl.append(a[1])

	while i < n:
		if ansl[-1] > a[i]:
			ansl.append(a[i])
		i += 1
	print(len(ansl))


	

if __name__ == '__main__':
	main()

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

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

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

min_value = number[0]

ans = 0

for p in number:
    if p <= min_value:
        ans += 1
        min_value = p
    

print(ans)

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

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

Solution (Python):



def solve(*args: str) -> str:
    n = int(args[0])
    P = list(map(int, args[1].split()))

    count = 0
    small = P[0]
    for i in range(n):
        if P[i] <= small:
            count += 1
        small = min(small, P[i])

    return str(count)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):

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

count = 0
value = 0

for i, value in enumerate(P):

    if i == 0:
        count += 1
        m = value
        continue

    elif m >= value:
        m = value
        count += 1

print(count)

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

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

cnt = 1
min = P[0]
flag = True

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

print(cnt)

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

t = []
t = list(map(int, input().split()))

count = 0
min = t[0]

for i in t:
    if i <= min:
        count = count + 1
        min = i



        
print(count)

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

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

count = 1 

flag = L[0]

for i in range(1,N):
    if L[i] <= flag:
        count += 1
        flag = L[i]
        if flag == 1:
            break
    

print(count)

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

mi = P[0]
cnt = 0

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

print(cnt)

Solution (Python):
import heapq


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


if __name__ == '__main__':
    main()

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

l = []
l.append(p[0])
temp = p[0]
for i in range(0, n-1):
  if p[i+1] < temp:
    temp = p[i+1]
    l.append(p[i+1])
    
print(len(l))

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
num_list = [int(i) for i in stdin.readline().rstrip().split()]
output = 0
min_value = float("inf")
for n in range(0, N):
    now_value = num_list[n]
    if min_value > now_value:
        output += 1
        min_value = now_value
    
    
    
print(output)

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

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

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

print(count)

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

"""
count = 0
for i in range(N):
	flag = 1
	for j in range(i):
		if P[i] <= P[j]:
			flag = 1
		else:
			flag = -1
			break

	if flag == 1:
		count += 1

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

print(count)

Solution (Python):
import sys
bbn=1000000007
	


		
def main():
	n = int(input())
	al = list(map(int, input().split()))
	count=0
	pre_max=al[0]
	for v in al:
		pre_max = min(v, pre_max)	
		if pre_max >= v:
			count+=1
	print(count)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

count = 1
minval = lstP[0]

for i in range(1, len(lstP)):
    val = lstP[i]
    if val <= minval:
        minval = val
        count += 1

print(count)

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

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

result = 1
minP = N

for i in range(1, N):
    minP = min(P[i-1], minP)
    if minP>P[i]:
        result+=1

print(result)

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

print(count)

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

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

print(ans)

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

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

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

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]
        if MIN == 1:
            break
print(count)

Solution (Python):


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

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


print(count)

Solution (Python):
N = int(input())
P = map(int, input().split())
cmin = N + 1
count = 0
for c in P:
    if c <= cmin:
        count += 1
        cmin = c
print(count)

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

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

h = []
heapq.heapify(h)
ans=0
for i in range(len(p)):
    heapq.heappush(h,p[i])
    m = heapq.heappop(h)
    if m==p[i]:
        ans+=1
    heapq.heappush(h,m)
print(ans)

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

min_num = n + 1
count = 0
for i in range(n):
    if min_num > p[i]:
        min_num = p[i]
        count = count + 1
print("{}".format(count))

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

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

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

print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
minP = []
ans = 0
for idx, p in enumerate(P):
    if idx == 0:
        minP.append(p)
    else:
        minP.append(min(minP[idx-1], p))

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

print(ans)

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

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

for i in a:
    if a_min >= i:
        cnt += 1
        a_min = i

print(cnt)

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

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

print(count)

Solution (Python):
import sys

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

min_element = sys.maxsize
result = 0
for i in range(len(P)):
    if P[i] <= min_element:
        min_element = P[i]
        result += 1
    else:
        continue

print(result)

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

print(count)

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

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

answer = 0
now_min = 999999
for i in range(len(p_li)):
    if now_min > p_li[i]:
        now_min = p_li[i]
        answer += 1

print(answer)

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

if n == 1:
    print(1)
    exit()

count = 0
base = P[0]
for i in range(n - 1):

    if base >= P[i + 1]:
        count += 1
        base = P[i + 1]

print(count+1)

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

Solution (Python):
import sys

input = sys.stdin.readline

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

MIN = P[0]
count = 1
for i, p in enumerate(P[1:]):
    if p <= MIN:
        count += 1

    if p < MIN:
        MIN = p

print(count)