n=int(eval(input()))

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

mi=10**9

mi_lst=[]

cnt=0

for i in range(n):

  if l[i]<mi:

    mi_lst.append(l[i])

    mi=min(mi,l[i])

    cnt+=1

  else:mi_lst.append(l[-1])

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

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

mi=10**9

cnt=0

for i in range(n):

  if l[i]<mi:

    mi=min(mi,l[i])

    cnt+=1

print(cnt)
n = int(eval(input()))
l = list(map(int, input().split()))
mi = 10**9
mi_lst = []
cnt = 0
for i in range(n):
    if l[i] < mi:
        mi_lst.append(l[i])
        mi = min(mi, l[i])
        cnt += 1
    else:
        mi_lst.append(l[-1])
print(cnt)

n = int(eval(input()))
l = list(map(int, input().split()))
mi = 10**9
cnt = 0
for i in range(n):
    if l[i] < mi:
        mi = min(mi, l[i])
        cnt += 1
print(cnt)

-mi_lst = [] -        mi_lst.append(l[i]) -    else: -        mi_lst.append(l[-1])