N, *P = list(map(int, open(0).read().split()))



min_v = 10 ** 6

max_v = 0

ans = 0

for i in range(N):

    if P[i] < min_v:

        ans += 1

        min_v = P[i]

    elif P[i] > max_v:

        max_v = P[i]

        

print(ans)



N = int(eval(input()))

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



ans = 0

cur = 10 ** 6

for i in range(N):

    if X[i] <= cur:

        ans += 1

    cur = min(cur, X[i])



print(ans)

N, *P = list(map(int, open(0).read().split()))
min_v = 10**6
max_v = 0
ans = 0
for i in range(N):
    if P[i] < min_v:
        ans += 1
        min_v = P[i]
    elif P[i] > max_v:
        max_v = P[i]
print(ans)

N = int(eval(input()))
X = list(map(int, input().split()))
ans = 0
cur = 10**6
for i in range(N):
    if X[i] <= cur:
        ans += 1
    cur = min(cur, X[i])
print(ans)

-N, *P = list(map(int, open(0).read().split())) -min_v = 10**6 -max_v = 0 +N = int(eval(input())) +X = list(map(int, input().split())) +cur = 10**6 -    if P[i] < min_v: +    if X[i] <= cur: -        min_v = P[i] -    elif P[i] > max_v: -        max_v = P[i] +    cur = min(cur, X[i])