N = int(eval(input()))

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



rui = [None] * (N)

rui[0] = P[0]

# print(rui)



for i in range(1, N):

    a = rui[i-1]

    b = P[i]

    rui[i] = min(a, b)





c = 0

for i in range(N):

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

        c += 1

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

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



mn = N+1

c = 0

for pi in P:

    if pi <= mn:

        c += 1

        mn = pi



print(c)
N = int(eval(input()))
P = list(map(int, input().split()))
rui = [None] * (N)
rui[0] = P[0]
# print(rui)
for i in range(1, N):
    a = rui[i - 1]
    b = P[i]
    rui[i] = min(a, b)
c = 0
for i in range(N):
    if P[i] <= rui[i]:
        c += 1
print(c)

N = int(eval(input()))
P = list(map(int, input().split()))
mn = N + 1
c = 0
for pi in P:
    if pi <= mn:
        c += 1
        mn = pi
print(c)

-rui = [None] * (N) -rui[0] = P[0] -# print(rui) -for i in range(1, N): -    a = rui[i - 1] -    b = P[i] -    rui[i] = min(a, b) +mn = N + 1 -for i in range(N): -    if P[i] <= rui[i]: +for pi in P: +    if pi <= mn: +        mn = pi