n=int(eval(input()))

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

a=p[0]

cnt=1

for i in range(n):

    if p[i]<a:

        cnt+=1

        a=p[i]

        if p[i]==1:

            break

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

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

a=p[0]

cnt=1

for i in p:

    if i<a:

        cnt+=1

        a=i

        if i==1:

            break

print(cnt)
n = int(eval(input()))
p = list(map(int, input().split()))
a = p[0]
cnt = 1
for i in range(n):
    if p[i] < a:
        cnt += 1
        a = p[i]
        if p[i] == 1:
            break
print(cnt)

n = int(eval(input()))
p = list(map(int, input().split()))
a = p[0]
cnt = 1
for i in p:
    if i < a:
        cnt += 1
        a = i
        if i == 1:
            break
print(cnt)

-for i in range(n): -    if p[i] < a: +for i in p: +    if i < a: -        a = p[i] -        if p[i] == 1: +        a = i +        if i == 1: