n=int(eval(input()))

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



m=a[0]

ans=0

for i in a:

  if i<=m:

    ans+=1

  m=min(i,m)

  #print(m)

  

print(ans)
now_min=float("inf")

n=int(eval(input()))

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

ans=0

for pi in p:

  if pi<=now_min:

    ans+=1

    now_min=pi

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
m = a[0]
ans = 0
for i in a:
    if i <= m:
        ans += 1
    m = min(i, m)
    # print(m)
print(ans)

now_min = float("inf")
n = int(eval(input()))
p = list(map(int, input().split()))
ans = 0
for pi in p:
    if pi <= now_min:
        ans += 1
        now_min = pi
print(ans)

+now_min = float("inf") -a = list(map(int, input().split())) -m = a[0] +p = list(map(int, input().split())) -for i in a: -    if i <= m: +for pi in p: +    if pi <= now_min: -    m = min(i, m) -    # print(m) +        now_min = pi