n = int(eval(input()))

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



t = p[0]

ans = 0

for i in range(n):

    if t >= p[i]:

        ans += 1

    t = min(p[i],t)



print(ans)
n = int(eval(input()))

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



t = p[0]

ans = 0

for i in range(n):

    if t >= p[i]:

        ans += 1

        t = p[i]



print(ans)
n = int(eval(input()))
p = [int(i) for i in input().split()]
t = p[0]
ans = 0
for i in range(n):
    if t >= p[i]:
        ans += 1
    t = min(p[i], t)
print(ans)

n = int(eval(input()))
p = [int(i) for i in input().split()]
t = p[0]
ans = 0
for i in range(n):
    if t >= p[i]:
        ans += 1
        t = p[i]
print(ans)

-    t = min(p[i], t) +        t = p[i]