N=int(eval(input()))

P=[int(x) for x in input().rstrip().split()]



mi=2*10**5+1

cnt=0

for i in P:

  

  if i<=mi:

    cnt+=1

  mi=min(mi,i)

print(cnt)

n=int(eval(input()))

p=[int(x) for x in input().rstrip().split()]



now_min=float('inf')

cnt=0

for i in range(n):

  if p[i]<=now_min:

    cnt+=1

    now_min=p[i]

  

print(cnt)



N = int(eval(input()))
P = [int(x) for x in input().rstrip().split()]
mi = 2 * 10**5 + 1
cnt = 0
for i in P:
    if i <= mi:
        cnt += 1
    mi = min(mi, i)
print(cnt)

n = int(eval(input()))
p = [int(x) for x in input().rstrip().split()]
now_min = float("inf")
cnt = 0
for i in range(n):
    if p[i] <= now_min:
        cnt += 1
        now_min = p[i]
print(cnt)

-N = int(eval(input())) -P = [int(x) for x in input().rstrip().split()] -mi = 2 * 10**5 + 1 +n = int(eval(input())) +p = [int(x) for x in input().rstrip().split()] +now_min = float("inf") -for i in P: -    if i <= mi: +for i in range(n): +    if p[i] <= now_min: -    mi = min(mi, i) +        now_min = p[i]