N = int(eval(input()))

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

cnt = 0

P_min = 200000

for i in range(N):

    if P_min > P[i]:

        P_min = P[i]

    if P_min == P[i]:

        cnt += 1

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

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

min1 = A_list[0]

cnt = 0

for i in range(N):

    if A_list[i] <= min1:

        min1 = A_list[i]

        cnt += 1

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

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

-P = list(map(int, input().split())) +A_list = list(map(int, input().split())) +min1 = A_list[0] -P_min = 200000 -    if P_min > P[i]: -        P_min = P[i] -    if P_min == P[i]: +    if A_list[i] <= min1: +        min1 = A_list[i]