N = int(eval(input()))

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



cnt = 0

mark = ps[0]

for p in ps:

    if mark >= p:

        cnt += 1

        mark = min(mark, p)



print(cnt)

N = int(eval(input()))

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



cnt = 1

mark = ps[0]

for p in ps[1:]:

    if mark >= p:

        cnt += 1

        mark = p



print(cnt)

N = int(eval(input()))
ps = [int(i) for i in input().split()]
cnt = 0
mark = ps[0]
for p in ps:
    if mark >= p:
        cnt += 1
        mark = min(mark, p)
print(cnt)

N = int(eval(input()))
ps = [int(i) for i in input().split()]
cnt = 1
mark = ps[0]
for p in ps[1:]:
    if mark >= p:
        cnt += 1
        mark = p
print(cnt)

-cnt = 0 +cnt = 1 -for p in ps: +for p in ps[1:]: -        mark = min(mark, p) +        mark = p