Problem:
 Score : 300 points    Problem Statement  Given is a permutation P_1, \ldots, P_N of 1, \ldots, N .
Find the number of integers i  (1 \leq i \leq N) that satisfy the following condition:   For any integer j  (1 \leq j \leq i) , P_i \leq P_j .       Constraints   1 \leq N \leq 2 \times 10^5  P_1, \ldots, P_N is a permutation of 1, \ldots, N .  All values in input are integers.         Input  Input is given from Standard Input in the following format:  N  P_1  ...  P_N       Output  Print the number of integers i that satisfy the condition.        Sample Input 1 5
4 2 5 1 3      Sample Output 1 3  i=1 , 2 , and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1 . Similarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.       Sample Input 2 4
4 3 2 1      Sample Output 2 4  All integers i  (1 \leq i \leq N) satisfy the condition.       Sample Input 3 6
1 2 3 4 5 6      Sample Output 3 1  Only i=1 satisfies the condition.       Sample Input 4 8
5 7 4 2 6 8 1 3      Sample Output 4 4       Sample Input 5 1
1      Sample Output 5 1

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

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

cnt = 1
lmin = lp[0]
for i in range(1, N):
    if lp[i] < lmin:
        lmin = lp[i]
        cnt += 1
    elif lp[i] == 1:
        break

print(cnt)

Solution (Python):

"""
Created on Sat May  9 01:35:28 2020

@author: shinba
"""
n = int(input())
p = list(map(int,input().split()))

ans = 1
m = p[0]

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

print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
m =[0] * n
m[0] = p[0]
mi = m[0]
for i in range(1, n):
    mi = min(mi, p[i])
    m[i] = mi
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()))
P_max = []
P_min = []

for i in range(N):
  if not P_max:
    P_max.append(P[0])
    P_min.append(P[0])
  else:
    P_max.append(max(P_max[-1], P[i]))
    P_min.append(min(P_min[-1], P[i]))
    
ans = 0
for i in range(N):
  if P[i] <= P_max[i] and P[i] <= P_min[i]:
    ans += 1
    
print(ans)

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

cnt = 0
min_p = float("inf")
for p in P:
    if p <= min_p:
        min_p = p
        cnt+=1
print(cnt)

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

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

temp = 11111111111111111
cnt = 0
for i in p:
    temp = min(temp,i)
    if temp >= i:
        cnt += 1
print(cnt)

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

gomi=max(plist)
output=0

for p in plist:
    if p == plist[0]:
        gomi=p
        output+=1
    else:
        if p <= gomi:
            gomi=p
            output+=1

print(output)

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

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

print(count)

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

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

print(cnt)

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

maxes = []
mins  = []

max = 0
min = 0
result = 0

for i in range(N):
    if i == 0:
        max = P[i]
        min = P[i]
    else:
        if(max < P[i]):
            max = P[i]
        if(min > P[i]):
            min = P[i]

    maxes.append(max)
    mins.append(min)

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

print(result)

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

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

Solution (Python):


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

count = 0

tmp_min = Ps[0]
for i in range(N):
    
    if(tmp_min >= Ps[i]):
        count += 1
        tmp_min = Ps[i]
    else:
        pass
    
    
print(count)

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

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

for n in range(1,N):
  if P[n]<=P2[-1]: 
    P2.append(P[n])
  
print(len(P2))

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
cnt=0
min_num = 10**9

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

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

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

min_value=Nums[0]

cnt=0

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

print(cnt)

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

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

print(count)

Solution (Python):
import numpy as np

n = int(input())
P = np.array(list(map(int, input().split())))
T = np.zeros(n)
T[0] = P[0]
for i in np.arange(1,n,1):
    T[i] = min(T[i-1], P[i])
print(np.sum(P==T))

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n = I()
P = LI()
ans = 0
tmp = INF
for i in range(n):
    if P[i] < tmp:
        ans += 1
        tmp = P[i]
print(ans)

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

cnt = 0
tmp = p[0]

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

Solution (Python):


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

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

print(cnt)

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

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

'''
参考
https://cocoinit23.com/abc152/
すべての(i, j)を調べていると制限時間を超過してしまう。
listの2つ目の要素(index=1)から順に見ていって、最小値が更新されたら解をカウントアップする。
ただし、解の最小値は常に1となるので、解の初期値は1にしておくこと。
'''
ans = 1
min_p = P[0]

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

print(ans)

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

        
print(cnt)

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

ans = 1
mini = p[0]

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

Solution (Python):
from sys import stdin


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

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


if __name__ == "__main__":
    main()

Solution (Python):


N = int(input().strip())
P_list = list(map(int, input().rstrip().split()))

min_P = float("inf")
cnt = 0

for p in P_list:
    if min_P >= p:
        cnt += 1
        min_P = min(min_P, p)

print(cnt)

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

cnt = 0

for j in range(N):
  if P[j] == Pmin[j]:
    cnt += 1
  else:
    pass
print(cnt)

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

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

print(ans)

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

count = 0
mini = n + 1
for p in map(int, input().split()):
    if mini >= p:
        count += 1
        mini = p

print(count)

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

min_p = P[0]
cnt = 0
for p in P:
    if p <= min_p:
        cnt += 1
        min_p = p
print(cnt)

Solution (Python):
n,*a=map(int,open(0).read().split())
ans=1
s=a[0]
for i in range(1,n):
  if a[i]<=s:
    ans+=1
  s=min(s,a[i])
print(ans)

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

num = p[0]
ans = 1

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

print(ans)

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

ans = 0
p_min = N + 1
for i in range(N):
  p_min = min(p_min,p[i])
  if p_min == p[i]:
    ans += 1
    
print(ans)

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

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

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

    if P[i-1] == m :
        cnt = cnt + 1

print(cnt)

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

    ans = 0
    tmp = N + 1
    for p in P:
        if tmp > p:
            ans += 1
            tmp = p
    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
N = int(input())
P_list = list(map(int,input().split()))
M = P_list[0]
cnt = 1

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

print(cnt)

Solution (Python):


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

    mini = 10**6
    cnt = 0
    for _ in P:
        if _ < mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()

Solution (Python):
N=int(input())
P=[int(i) for i in input().split()]
min=2*(10**5)+1
cnt=0
for r in P:
    if min>=r:
        min=r
        cnt+=1
    else:
        continue
print(cnt)

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

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


if __name__ == '__main__':
    main()

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

res = 0
mi = N + 1
for i in range(N):
    mi = min(mi, P[i])
    if mi == P[i]:
        res += 1

print(res)

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

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

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

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

print(ans)

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

Solution (Python):

"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""


"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""



"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""


"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""

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

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

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

print(cnt)

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

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

count = 0


min0 = p[0]
count+=1

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

print(count)

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

Solution (Python):
def solve():
    N = int(input())
    P = list(map(int, input().split()))
    now = N + 1
    cnt = 0
    for p in P:
        if now > p:
            cnt += 1
            now = p
    return cnt

print(solve())

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
P = LIST()

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

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
P = LIST()

cnt = 1
MIN = P[0]

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

print(cnt)

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

v = pn[0]
ans = 1
for i in range(1, n):
    if v > pn[i]:
        v = pn[i]
        ans += 1
print(ans)

Solution (Python):
import numpy as np
N = int(input())
P = list(map(int, input().split()))
P.append(0)
P = np.array(P)
ans = 1
tmp = P[0]
for i in range(1,N):
  if P[i] < tmp:
    ans += 1
    tmp = P[i]
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]





N = ii()
A = li()

min_a = float('inf')

cnt = 0
for num in A:
    if num < min_a:
        cnt += 1
        min_a = num
print(cnt)

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

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

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

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

Solution (Python):
N=int(input())
P = [int(i) for i in input().split()]
min = P[0]
lowelemcnt=1
for p in P[1:]:
  if min >= p:
    lowelemcnt += 1
    min=p
print(lowelemcnt)

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

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

print(ans)

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


if __name__ == "__main__":
    main()

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

min_list = [0 for i in range(N)]
min_list[0] = P[0]
for i, p in enumerate(P):
    if i == 0:
        continue
    if p < min_list[i-1]:
        min_list[i] = p
    else:
        min_list[i] = min_list[i-1]

ans = 0
for i, p  in enumerate(P):
    if p <= min_list[i]:
        ans += 1
print(ans)

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

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

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

for i in range(1,len(pn)):
    if min > pn[i - 1]: min = pn[i - 1]
    if min > pn[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 p[i]<=min:
        ans+=1
        min=p[i]
print(ans)

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

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

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

counter = 0
min = P[0]
for i in P:
    if min >= i:
        counter += 1
        min = i
print(counter)

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

print(count)

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

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

mi=2*10**5+1
cnt=0
for i in P:
  
  if i<=mi:
    cnt+=1
  mi=min(mi,i)
print(cnt)

Solution (Python):
n = int(input())
p_list = list(map(int, input().split()))
i_sum = 0
p_min = p_list[0]

for i in range(n):
    if p_min >= p_list[i]:
        i_sum += 1
        p_min = p_list[i]
    else:
        continue
print(i_sum)

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

Solution (Python):
import numpy as np
n = int(input())
p = np.array(input().split(),dtype=int)

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

print(ans)

Solution (Python):


import sys



















def main():
    mod = 1000000007                  
    inf = float('inf')
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    n = ii()
    L = lmi()
    current_min = float('inf')
    cnt = 0
    for elm in L:
        if elm <= current_min:
            cnt += 1
            current_min = elm
    print(cnt)

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
min = li[0]
cnt = 0
for i in li:
  if i < min:
    cnt += 1
    min = i
  elif i == min:
    cnt += 1
print(cnt)

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

Solution (Python):
def Main(N, P):
    ans = 1
    mi = P[0]
    for i in range(1, N):
        if mi > P[i]:
            ans += 1
            mi = P[i]
    return ans

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

if __name__ == '__main__':
    main()

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

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

print(count)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
ans = [10**6]
for i in P:
    if i < ans[-1]:
        ans.append(i)
print(len(ans)-1)

Solution (Python):

import sys
input=sys.stdin.buffer.readline

import numpy as np

N = int(input())
L=list(map(int,input().split()))
P = np.array(L,np.int32)

Q = np.minimum.accumulate(P)
answer = np.count_nonzero(P <= Q)

print(answer)

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

ans = 0
temp = 2*(10**5)+1
for i in s:
    if i <= temp:
        ans += 1
    temp = min(temp,i)
    
print(ans)

Solution (Python):
def main2():
    input()
    t = list(map(int, input().split()))
    count = 0
    m = t[0]
    for val in t:
        if val <= m:
            count += 1
            m = val
    print(count)


if __name__ == '__main__':
    main2()

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

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

cnt = 0
min_num = P[0]
for num in P:
  if num == min_num:
    cnt += 1
  elif num < min_num:
    cnt += 1
    min_num = num
  
print(cnt)

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

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


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

print(p_sum)

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

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

print(ans)

Solution (Python):


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

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

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

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

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

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 += 1
        min = P[i]
print(ans)

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

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

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

print(count)

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

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

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

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

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    P = il()
    ret = 0
    mi = P[0]
    for n in range(N):
        if mi >= P[n]: ret += 1
        mi = min(mi, P[n])
    print(ret)


if __name__ == '__main__':
    main()

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

print(count)

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

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

print(cnt)

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

Solution (Python):


N = int(input())
P = list(map(int, input().split()))
cnt = 0
tmp = 10 ** 10

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

print(cnt)

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

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

tmp = 10 ** 10
count = 0
for i in range(N):
    if tmp >= L[i]:
        count += 1
    tmp = min(tmp, L[i])
        
print(count)

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

num = p[0]
ans = 1

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

print(ans)

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

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

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

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

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

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

m = 10**6
c = 0

for i in range(0,len(A)):
    if m >= A[i]:
        m = A[i]
        c += 1

print(c)

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

min = 10**6
count = 0

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

print(count)

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

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

Solution (Python):
from collections import deque
N = int(input())
P = list(map(int, input().split()))

d = deque(P)
count = 1

for i in range(1, N):
    if (d[0] >= d[1]):
        d.popleft()
        count += 1
    else:
        d1 = d.popleft()
        d2 = d.popleft()
        d.appendleft(d1)

print(count)