n=int(eval(input()))

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



ans=0

pre=float('inf')

for i in range(n):

       if P[i]<=pre:

              ans+=1

              pre=P[i]

print(ans)

              
n=int(eval(input()))

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

ans=0

bef=float("inf")

for i in P:

    if i<=bef:

        ans+=1

        bef=i

print(ans)
n = int(eval(input()))
P = list(map(int, input().split()))
ans = 0
pre = float("inf")
for i in range(n):
    if P[i] <= pre:
        ans += 1
        pre = P[i]
print(ans)

n = int(eval(input()))
P = list(map(int, input().split()))
ans = 0
bef = float("inf")
for i in P:
    if i <= bef:
        ans += 1
        bef = i
print(ans)

-pre = float("inf") -for i in range(n): -    if P[i] <= pre: +bef = float("inf") +for i in P: +    if i <= bef: -        pre = P[i] +        bef = i