N = int(eval(input()))

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

cnt, i = 1, 0

min = P[0]

for i in range(i + 1, N):

  if min >= P[i]:

    cnt += 1

    min = P[i]

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

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

cnt = 1 # P[0] is counted forcely

min = P[0]

for p in P:

  # (1≤j≤i),Pj=>Pi

  if min > p:

    min = p

    cnt += 1

print(cnt)
N = int(eval(input()))
P = list(map(int, input().split()))
cnt, i = 1, 0
min = P[0]
for i in range(i + 1, N):
    if min >= P[i]:
        cnt += 1
        min = P[i]
print(cnt)

N = int(eval(input()))
P = list(map(int, input().split()))
cnt = 1  # P[0] is counted forcely
min = P[0]
for p in P:
    # (1≤j≤i),Pj=>Pi
    if min > p:
        min = p
        cnt += 1
print(cnt)

-cnt, i = 1, 0 +cnt = 1  # P[0] is counted forcely -for i in range(i + 1, N): -    if min >= P[i]: +for p in P: +    # (1≤j≤i),Pj=>Pi +    if min > p: +        min = p -        min = P[i]