#C

N = int(eval(input()))

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

ans = 0

min_num = 10**6



for i in range(N):

    min_num = min(min_num, P[i])

    if min_num >= P[i]:

        ans += 1

        

print(ans)
N = int(eval(input()))

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



min_tmp = N+1

ans = 0



for p in P:

    if min_tmp >= p:

        ans += 1

        min_tmp = p

    else:

        continue



print(ans)

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

N = int(eval(input()))
P = list(map(int, input().split()))
min_tmp = N + 1
ans = 0
for p in P:
    if min_tmp >= p:
        ans += 1
        min_tmp = p
    else:
        continue
print(ans)

-# C +min_tmp = N + 1 -min_num = 10**6 -for i in range(N): -    min_num = min(min_num, P[i]) -    if min_num >= P[i]: +for p in P: +    if min_tmp >= p: +        min_tmp = p +    else: +        continue