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

import numpy as np
N = int(input())
P = np.array(list(map(int, input().split())))

MIN = P[0]
count = 1
for p in P[1:]:
    if p < MIN:
        count += 1
        MIN = p

print(count)

Solution (Python):
size = int(input())
nums = list(map(int,input().split()))

min_num = nums[0]
count = 0

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

print(count)

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

print("%d"%(count))

Solution (Python):
import sys

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

answer = 0
prevMin = 2 ** 32
for i in range(N):
    if P[i] <= prevMin:
        answer += 1
        prevMin = P[i]

print (answer)

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 = count+1
print(count)

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

A = list(map(int, input().split()))
small = A[0]
c = 0
for i in A:
    if small >= i:
        c += 1
        small = i
        
print(c)

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

if __name__ == '__main__':
    main()

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

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

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

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

print(ans)

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

ans = 1
Min = P[0]

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

print(ans)

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

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

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

now = 99999999
sumc = 0
for count in range(0,N):
    if P[count] < now:
        sumc += 1
        now = P[count]
print(sumc)

Solution (Python):

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

min_s=[P[0]+1]

ans=len([min_s.append(s) for s in P if s < min_s[-1]])
print(ans)

Solution (Python):
listA=[]

for i in range(2):
    try:
        listA.append(list(map(int, input().split())))
        
        
        
    except:
        break;
        

list=listA[1]

mini=float('inf')
count=0

for i in list:
    if i <= mini:
        count+=1
        mini=i

print(count)

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

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

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

print(ans)

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

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

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

print(count)

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

Solution (Python):
n,*p=map(int,open(0).read().split())
m=n+1
ans=0
for x in p:
  if m>x:
    ans+=1
    m=x
print(ans)

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

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
cnt = 0
min_num = 2 * (10 ** 5) +1

for i in A:
    if min_num > i:
        min_num = i
        cnt += 1
print(cnt)

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

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

Solution (Python):
def main(length_num,num_list):
    count_num = 0
    min_num = int(num_list[0])
    for i in num_list:
        if int(min_num) >= int(i):
            min_num = i
            count_num += 1           
    return count_num
    
if __name__ == "__main__":
    input_length_num = int(input())
    input_num2 = input()
    input_num_list = input_num2.split()
    print(main(input_length_num,input_num_list))

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

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

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

for ln in l:
  if m >= ln:
    m = ln
    ans+=1
    
print(ans)

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

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

cnt = 0
m = N

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

print(cnt)

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

result = 0
min_value=P[0]
for index, current_value in enumerate(P):
  if (min_value >= current_value):
    result += 1
    min_value = current_value

print(result)

Solution (Python):

import sys
import numpy as np


def solve(N: int, P: "List[int]"):
    P = np.array(P)
    Q = np.minimum.accumulate(P)
    
    print(np.sum(P<=Q))




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    P = [int(next(tokens)) for _ in range(N)]  
    solve(N, P)

if __name__ == '__main__':
    main()

Solution (Python):

import sys


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



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    P = [int(next(tokens)) for _ in range(N)]  
    solve(N, P)

if __name__ == '__main__':
    main()

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

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

cnt = 1
min_p = p[0]

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

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

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

count = 0
min_ = float("inf")
for n in seq:
    if n < min_:
        min_ = n
        count += 1

print(count)

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

count = 1
min = P[0]

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    p = list(map(int, readline().split()))
    t = 10 ** 6
    cnt = 0
    for i in range(n):
        t = min(t, p[i])
        if t >= p[i]:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    solve()

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

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

P_min = N + 1
result = 0

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

print(result)

Solution (Python):
n, *p_n = map(int, open(0).read().split())

count = 0
min_num = p_n[0]
for p in p_n:
    if p <= min_num:
        min_num = p
        count += 1
print(count)

Solution (Python):
n, *p_n = map(int, open(0).read().split())

count = 0
p_n_min = p_n[0]
for i in range(n):
    p_n_min = min(p_n_min,p_n[i])
    if p_n_min == p_n[i]:
        count += 1
print(count)

Solution (Python):


import sys

def solve(n, ps):
    pmin = ps[0]
    c = 0
    for i in range(0, len(ps)):
        if ps[i] <= pmin:
            pmin = ps[i]
            c += 1
    return c

def main():
    n = int(sys.stdin.readline().strip())
    nstr = sys.stdin.readline().strip()

    ps = []
    i = 0
    for c in range(0, n):
        iend = nstr.find(" ", i)
        if iend < 0:
            iend = len(nstr)
        ps.append(int(nstr[i:iend]))
        i = iend + 1

    ans = solve(n, ps)

    print(ans)

if __name__ == '__main__':
    main()

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

minValue = P[0]

for i, p in enumerate(P):
  if (minValue >= p):
    result += 1
    minValue = p

print(result)

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

ans = 0
min = N+1

for i in list_P :
    if i < min :
        ans += 1
        min = i

print(ans)

Solution (Python):
n = int(input())
a = [int(z) for z in input().split()]

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

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

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

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

Solution (Python):
n = int(input())
p_lst = list(map(int,input().split()))
number = 1
p_min = p_lst[0]

for i in range(1,n):
    if p_lst[i]<=p_min:
        number += 1
        p_min = p_lst[i]

print(number)

Solution (Python):
from numpy import *

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

l = zeros(N+1, dtype=int)

l[0] = P[0]
j = 0
for i in range(1, N):
    if P[i] < l[j]:
        l[j+1] = P[i]
        j += 1
    else:
        pass


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

print(count)

Solution (Python):
import sys
read=sys.stdin.buffer.read
N,*P=map(int,read().split())
max_val=float('inf')
cnt=0
for p in P:
  max_val=min(max_val,p)
  if max_val == p :
    cnt+=1
print(cnt)

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

c = 0
for i in range(N - 1):
    f = P[i]
    l = P[i + 1]
    if f < l:
        P[i] = l
        P[i+1] = f
        c += 1

print(N - c)

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

def main():
    N = int(input())
    a = list(map(int,input().split()))
    
    ans = 0
    num = 10**6
    for p in a:
        if p < num:
            ans += 1
            num = p
    
    print(ans)
    
if __name__ == "__main__":
    main()

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

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

print(count)

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

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

print(ans)

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

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

Solution (Python):
n = int(input())
arr = list(map(int, input().split()))
mini, res = n+1, 0
for i in arr:
    if i < mini:
        mini = i
        res += 1
print(res)

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

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

ans = 1
min_val = p[0]

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

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

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

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

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

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

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

cnt = 0 
minval = int(2e5)+1

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

print(cnt)

Solution (Python):
import copy
a=int(input())
c=list(map(int, input().split()))
minnum=c[0]
ans=1
for i in range(1,a):
    if(minnum>c[i]):
        ans+=1
        minnum=c[i]

print(ans)

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

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

k = 0
for i in range(len(num_list)):
    if i == 0:
        temp_min = num_list[i]
    else:
        temp_min = min(temp_min, num_list[i])
        
    if i != len(num_list)-1:
        if temp_min == num_list[i]:
            k += 1
    else:
        if temp_min == num_list[i]:
            k += 1
    
print(k)

Solution (Python):
import numpy as np
import itertools

def main():
    N = int(input())
    P = np.array([int(x) for x in input().split()])
    
    Q = np.array(list(itertools.accumulate(P, min)))

    print(np.count_nonzero(P <= Q))

if __name__ == '__main__':
    main()

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

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

Solution (Python):
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    ans = 0
    minP = P[0]

    for i in range(N):
        minP = min(minP, P[i])
        if P[i] <= minP:
            ans += 1
    
    print(ans)
        
if __name__ == '__main__':
    main()

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

Solution (Python):
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys




import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N = int(readline())

P = np.array(readline().split(), np.int32)
Q = np.minimum.accumulate(P)
ans = np.count_nonzero(P <= Q)
print(ans)

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

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

ans = 1

P_min = P[0]

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

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

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

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

min=p[0]
cnt=0

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

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

m=2*(10**5)+1
count = 0
for i in range(0, n):
  if p[i] <= m:
    m = p[i]
    count = count + 1

print(count)

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

count = 1
if N == 1:
  print(count)
else:
  min = P[0]
  if P[1] <= P[0]:
    count+=1
    min = P[1]

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

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

m = -1
ans = 0

for i, item in enumerate(P):
  if i==0:
    m = item
    ans += 1
  else :
    if (m >= item):
      m = item
      ans += 1
      
print(ans)

Solution (Python):
from sys import stdin

a=int(input())

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

e = 0
mini = i[0]
count = 0

while e < a:
    if e == 0:
        count += 1
    elif i[e] < mini:
        count += 1
        mini = i[e]
    e += 1

print(count)

Solution (Python):
num = int(input())
p = map(int, input().split())
pList = list(p)
ret = 0

min = pList[0]
for i in range(num):
    if pList[i] <= min:
        min = pList[i]
        ret = ret + 1

print("{}".format(ret))

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

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

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

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

print (count)

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

count = 0

m = p[0]
for i in range(len(p)):
    if m >= p[i]:
        count += 1
        m = p[i]

print(count)

Solution (Python):
from sys import stdin
n = int(stdin.readline())
l = list(map(int,stdin.readline().split()))
ans = 0
m = float('inf')
for u in l:
	if u<=m: m = u; ans += 1
print(ans)

Solution (Python):

N = int(input())

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

minimum = P[0]
icount = 1

for x in P[1:]:
    if minimum >= x:
        icount += 1
        minimum = x

print(icount)

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

res = 1
min_el = A[0]

for i in range(1, N):
    if A[i] <= min_el:
        res += 1
        min_el = A[i]

print(res)

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

cnt=1
min_v=p[0]

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

print(cnt)

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

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

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

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

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

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

    ans = 0;
    m = 0
    for i, p in enumerate(P):
        if p < m or i == 0:
            m = p
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import heapq
N = int(input())
P = list(map(int,input().split()))
heap = []
heapq.heappush(heap,10**6)
ans = 0 
m = 10 ** 6
for i in range(N):
    if heap[0] > P[i]:
        ans += 1
    heapq.heappush(heap,P[i])
print(ans)

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

Solution (Python):
def smaller(a,b):
  if a>b:
    return b
  else:
    return a

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

S=[P[0]]
for i in range(1,N):
  S.append(smaller(S[i-1],P[i]))
  

for i in range(N):
  if P[i]==S[i]:
    res+=1
print(res)

Solution (Python):

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

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

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

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

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

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

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

ans=0
thr=float('inf')
for i in range(N):
    if thr>=P[i]:
        thr=P[i]
        ans+=1
print(ans)

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

Solution (Python):
from sys import stdin

def main():
    n = int(stdin.readline().strip())
    l = list(map(int,stdin.readline().split()))
    ar = [-1 for _ in range(n)]
    ar[0] = l[0]
    ans = 1
    for i in range(1,n):
        if(l[i] <= ar[i-1]):
            ans+=1
            ar[i] = l[i]
        else:
            ar[i] = ar[i-1]
    print(ans)
        
main()

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

Solution (Python):
import sys
from io import StringIO
import unittest

def resolve():
    N = int(input())
    P = list(map(int, input().split()))
    m = P[0];
    cnt = 0;
    for p in P:
        if(p <= m) :
            m = p
            cnt = cnt + 1

    print(cnt)
resolve()

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

Min=P[0]
ans=1

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

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

for p in P:
    if p <= prev:
        ans += 1
    prev = min(p, prev)

print(ans)

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

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

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

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

Solution (Python):
n = int(input())                                                                                                        
seq = [int(x) for x in input().split()]                                                                                 
cur_d = float('inf')                                                                                                    
ans = 0                                                                                                                 
for i in seq:                                                                                                               
  if i < cur_d:
    cur_d = i
    ans += 1
print(ans)

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

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

Solution (Python):


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

std = lists[0]
ans = 1

for i in range(1,n):
    if lists[i] < std:
        ans += 1
        std = lists[i]
        
print(ans)

Solution (Python):
N = int(input().strip())
ns = [int(x) for x in input().split(' ')]
cnt=0
mini = 200001
for i in range(len(ns)):
  if ns[i] <mini:
    cnt+=1
    mini=ns[i]
print(cnt)

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

data = [int(s) for s in input().split()]

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

Solution (Python):
N = int(input())
list = list(map(int,input().split()))
a = 0
min = list[0]

for i in range(N):
  if min >= list[i]:
    min = list[i]
    a += 1
    
print(a)

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

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

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

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

ans = 1
lst_min = []
for i in range(n):
    if i == 0:
        lst_min.append(lst[i])
    else:
        lst_min.append(
            min(lst_min[i-1], lst[i])
        )
        if lst_min[i] == lst[i]:
            ans += 1
print(ans)

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

Solution (Python):
N = int(input())
P = [int(i) for i in input().rstrip().split(' ')]
c = 0
m = 2*10**5
for i,p in enumerate(P):
    if m >= p:
        m = p
        c += 1
print(c)

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

count = 0
minimum = 1+2*(10**5)

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

print(count)

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

for NextNum in P:
    if PreNum >= NextNum:
        Cor += 1
        if PreNum >= NextNum:
            PreNum = NextNum
print(Cor)

Solution (Python):
n = int(input())
P = list(map(int, input().split()))
c = 1
minimum = P.pop(0)
if minimum != 1:
    for p in P:
        if p <= minimum:
            c += 1
            minimum = p
        if p == 1:
            break
print(c)