N = int(eval(input()))

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



cur_min = N+1

count = 0

for i in range(N):

    if cur_min >= P[i]:

        cur_min = P[i]

        count += 1

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

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



Q = []

for i in range(N):

    if i == 0:

        Q.append(P[i])

    else:

        Q.append(min(Q[-1], P[i]))



cnt = 0

for i in range(N):

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

        cnt += 1

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

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

-cur_min = N + 1 -count = 0 +Q = [] -    if cur_min >= P[i]: -        cur_min = P[i] -        count += 1 -print(count) +    if i == 0: +        Q.append(P[i]) +    else: +        Q.append(min(Q[-1], P[i])) +cnt = 0 +for i in range(N): +    if P[i] <= Q[i]: +        cnt += 1 +print(cnt)